server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # SPA history fallback: unknown paths serve the app shell so client-side # routing works on hard reloads and deep links. location / { try_files $uri $uri/ /index.html; } # Never cache the shell or the runtime config, so a redeploy or an env # change is picked up on the next load. The hashed assets they point to are # cached immutably below. location = /index.html { add_header Cache-Control "no-store"; } location = /config.js { add_header Cache-Control "no-store"; } location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; } }