Alters nginx config for backend proxying to prevent caching in double-proxied environs

This commit is contained in:
2026-07-04 19:45:02 +00:00
parent 562c28b6cb
commit 8a3f8984f9
+8
View File
@@ -34,5 +34,13 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Host $host;
# Disable caching through the double-proxy chain (NPM → frontend nginx → API)
# Without this, browsers cache responses keyed by the HTTPS origin, then send
# conditional requests (If-None-Match) that get lost or mismatched in the proxy chain.
proxy_cache off;
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
add_header Pragma "no-cache" always;
add_header Vary "*" always;
} }
} }