Skip to content

Commit

Permalink
core: tools: nginx: Add cache path
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Jan 28, 2025
1 parent f6b610d commit 9ba156c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/tools/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
##
Expand Down Expand Up @@ -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/;
Expand Down

0 comments on commit 9ba156c

Please sign in to comment.