nginx sent index.html with no Cache-Control, so a browser could keep it after a deploy and ask for hashed assets the new build no longer has, and show an empty page. location / now adds Cache-Control: no-cache, which covers its try_files fallback to /index.html, and includes security-headers.conf again, since its own add_header drops the server's. /assets/ and the locations passed to the backend are unchanged. script/frontend-viewport-test fails unless / and a path that falls back to the page carry Cache-Control: no-cache and Content-Security-Policy, which comes from the same file as the other security headers. Model: opus-5-5
This commit is contained in:
@@ -30,8 +30,13 @@ server {
|
||||
access_log /dev/stdout combined;
|
||||
error_log /dev/stderr warn;
|
||||
|
||||
# With no-cache, a browser never uses a copy of the page that names
|
||||
# assets a newer build no longer has without first checking with the
|
||||
# server that it is current.
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
add_header Cache-Control no-cache;
|
||||
include /etc/nginx/security-headers.conf;
|
||||
}
|
||||
|
||||
# Cache static assets aggressively
|
||||
|
||||
Reference in New Issue
Block a user