diff --git a/core/tools/nginx/nginx.conf b/core/tools/nginx/nginx.conf index a88f52775a..c6643e5337 100644 --- a/core/tools/nginx/nginx.conf +++ b/core/tools/nginx/nginx.conf @@ -24,6 +24,9 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; + # Cache + proxy_cache_path /var/cache/nginx keys_zone=ourcache:10m levels=1:2 max_size=1g inactive=30d; + ## # Logging Settings ## @@ -53,6 +56,16 @@ http { return 204; } + location ~ ^/cache/(.*) { + resolver 8.8.8.8 ipv6=off; + set $target $1; + proxy_cache ourcache; + proxy_cache_valid 200 30d; + proxy_cache_revalidate on; + proxy_cache_use_stale error timeout invalid_header http_500 http_502 http_503 http_504; + proxy_pass https://$target; + } + location /ardupilot-manager/ { include cors.conf; proxy_pass http://127.0.0.1:8000/;