server { listen ${PORT:-8080}; server_name _; root /usr/share/nginx/html; index index.html; # Serve env.js with no-cache so runtime config is always fresh location = /env.js { add_header Cache-Control "no-store, no-cache, must-revalidate"; try_files $uri =404; } # Assets with long-lived cache (Vite hashes filenames) location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; } # SPA fallback — serve index.html for all non-file routes location / { try_files $uri $uri/ /index.html; } }