nsite-ts/nginx/default.conf

30 lines
684 B
Plaintext
Raw Normal View History

2024-09-25 13:37:32 -05:00
server {
listen 80;
2024-09-25 16:06:51 -05:00
listen [::]:80;
2024-09-25 13:37:32 -05:00
server_name nsite-proxy;
location / {
proxy_cache request_cache;
proxy_cache_valid 200 60m;
proxy_cache_valid 404 10m;
2024-09-26 08:59:09 -05:00
proxy_cache_key $uri;
2024-09-25 13:37:32 -05:00
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
add_header X-Cache $upstream_cache_status;
add_header X-Cache-Status $upstream_status;
expires 30d;
add_header Cache-Control "public, no-transform";
proxy_pass http://nsite;
2024-09-26 08:59:09 -05:00
proxy_set_header Host $host;
2024-09-25 13:37:32 -05:00
}
# Manual cache invalidation ( cant use proxy_cache_purge )
# location ~ /purge(/.*) {
# allow 127.0.0.1;
# deny all;
# proxy_cache_purge request_cache $scheme$proxy_host$1;
# }
}