server { listen 8097; listen [::]:8097; server_name _; root /usr/share/nginx/html; index index.html; # Pure client-side SPA — no server routes of its own, everything falls back to index.html. location / { add_header Cache-Control "no-cache"; try_files $uri $uri/ /index.html; } # Content-hashed build output: safe to cache forever. location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; } # The service worker must be revalidated on every load or updates never reach installed apps. location = /sw.js { add_header Cache-Control "no-cache"; } location = /manifest.webmanifest { default_type application/manifest+json; add_header Cache-Control "no-cache"; } }