Serve index.html no-cache on every route; check the theme script's CSP hash

`try_files` served the SPA fallback inside `location /`, so `/` and every
client route went out without `Cache-Control: no-cache`. The fallback is now
the last argument, an internal redirect to the exact no-cache location.

`src/csp.check.ts` recomputes the inline theme script's sha256 and fails
`bun run check` with the new value when the CSP no longer names it.
This commit is contained in:
2026-10-07 09:32:06 +02:00
parent ff3a31e515
commit 7d6cc5b0bf
3 changed files with 39 additions and 2 deletions
+4 -1
View File
@@ -42,10 +42,13 @@ server {
include /etc/nginx/security-headers.conf;
# The fallback is the last argument, so it is an internal redirect to the
# exact location below and `/` and every SPA route get its no-cache too; as
# a middle argument it was served from here, without one.
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html =404;
try_files $uri /index.html;
}
# Vite puts a content hash in every asset's name, so one can never change