Files
HokmPlay/nginx.conf
T
soroush.asadi fd7bef36d8
CI/CD / CI - API (dotnet build + engine sim) (push) Successful in 2m33s
CI/CD / CI - Web (tsc + next build) (push) Successful in 1m6s
CI/CD / Deploy - local stack (db + server + web) (push) Failing after 2m21s
fix: never cache HTML shell (no more stale bundles); tidy trick offsets
- nginx: serve the HTML shell with Cache-Control no-store so a new deploy (new
  chunk hashes) is picked up immediately — fixes the recurring stale-bundle
  "page couldn't load" at the source. Hashed /_next/static stays immutable.
- Trick offsets set to a clean symmetric cross.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 08:04:14 +03:30

26 lines
773 B
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Static Next.js export: serve the file, its .html twin, or fall back to the
# SPA shell (the app uses client-side hash routing).
location / {
try_files $uri $uri.html $uri/ /index.html;
}
# Never cache the HTML shell — so a new deploy (with new chunk hashes) is
# always picked up immediately and tabs don't load a stale bundle.
location ~* \.html$ {
add_header Cache-Control "no-cache, no-store, must-revalidate";
try_files $uri /index.html;
}
# Long-cache immutable, content-hashed build assets.
location /_next/static/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}