fix nginx.conf (#226)

This commit is contained in:
evanpelle
2025-03-12 12:29:08 -07:00
committed by GitHub
parent ea628570b2
commit 8b5d402d96
+16 -12
View File
@@ -196,20 +196,24 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
# Main location with conditional caching for index.html
# Location for index.html specifically
location ~* /index\.html$ {
proxy_pass http://127.0.0.1:3000;
add_header Cache-Control "public, max-age=1";
proxy_cache STATIC;
proxy_cache_valid 200 302 1s;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
add_header X-Cache-Status $upstream_cache_status;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
proxy_pass http://127.0.0.1:3000;
# Add caching for any index.html that might be served here
if ($request_uri ~* "index\.html$") {
add_header Cache-Control "public, max-age=1";
proxy_cache STATIC;
proxy_cache_valid 200 302 1s;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
add_header X-Cache-Status $upstream_cache_status;
}
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;