3 points · by birdculture · 2w ago · 1 comment
---
proxy_cache_path /var/cache/nginx/pkg levels=1:2 keys_zone=pkg_cache:10m max_size=4g inactive=30d use_temp_path=off;
proxy_cache_path /var/cache/nginx/pkg-meta levels=1:2 keys_zone=pkg_meta:5m max_size=500m inactive=1h use_temp_path=off;
server { listen 80; server_name pkg.8by3.net;
location ~\* /All/[^/]+\.pkg$ {
proxy_pass https://pkg.freebsd.org;
proxy_cache pkg_cache;
proxy_cache_valid 200 30d;
proxy_cache_use_stale error timeout updating;
proxy_cache_lock on;
proxy_ssl_server_name on;
proxy_set_header Host pkg.freebsd.org;
proxy_ignore_headers Cache-Control Expires Set-Cookie;
add_header X-Cache-Status $upstream_cache_status always;
}
location / {
proxy_pass https://pkg.freebsd.org;
proxy_cache pkg_meta;
proxy_cache_valid 200 30m;
proxy_cache_valid 404 1m;
proxy_cache_use_stale error timeout updating;
proxy_cache_lock on;
proxy_ssl_server_name on;
proxy_set_header Host pkg.freebsd.org;
proxy_ignore_headers Cache-Control Expires Set-Cookie;
add_header X-Cache-Status $upstream_cache_status always;
}