server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; gzip on; gzip_types text/css application/javascript image/svg+xml; gzip_min_length 256; # Assets use stable filenames and we redeploy in place, so revalidate on # every load (cheap — tiny files, 304s) instead of caching for a week. # A week-long cache here means redeploys leave returning players on stale # CSS/JS until expiry; no-cache avoids that footgun. location ~* \.(css|js|svg|png|ico)$ { add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Referrer-Policy "no-referrer-when-downgrade" always; add_header Cache-Control "no-cache" always; } # HTML entry point: always revalidate so redeploys show up immediately. location / { add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Referrer-Policy "no-referrer-when-downgrade" always; add_header Cache-Control "no-cache" always; try_files $uri $uri/ /index.html; } }