server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # SPA fallback: TanStack Router handles routing client-side, so any # unknown path must serve index.html instead of returning 404. location / { try_files $uri $uri/ /index.html; } # Long cache for hashed build assets (safe: filenames change on rebuild) location /assets/ { expires 30d; add_header Cache-Control "public, immutable"; } }