server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # SPA fallback location / { try_files $uri $uri/ /index.html; add_header Cache-Control "no-store, no-cache, must-revalidate"; } # Vite build outputs to /assets by default location /assets/ { expires 1y; add_header Cache-Control "public, immutable"; try_files $uri =404; } # optional: favicon (avoid noisy logs if missing) location = /favicon.ico { try_files $uri =204; access_log off; log_not_found off; } }