server { listen ${PORT}; 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"; } # Species SVGs/JSON: always revalidate (no hash in filename) location /species/ { add_header Cache-Control "no-cache"; } # SPA fallback — serve index.html for all non-file routes location / { try_files $uri $uri/ /index.html; } }