server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Service worker : jamais en cache long location = /sw.js { add_header Cache-Control "no-cache, no-store, must-revalidate"; } location = /manifest.webmanifest { add_header Cache-Control "no-cache"; } # SPA fallback location / { try_files $uri $uri/ /index.html; } # Assets immuables (Vite hash dans le nom) location /assets/ { expires 1y; add_header Cache-Control "public, immutable"; } }