Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: tools: nginx: Add cache path #3094

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading