server {
    listen 80;
    root /usr/share/nginx/html;
    index index.html;

    # SPA routing — toujours renvoyer index.html pour les routes React
    location / {
        try_files $uri $uri/ /index.html;
    }

    # Cache assets statiques (immutables car Vite les hash)
    location ~* \.(js|css|png|jpg|jpeg|svg|ico|woff2?)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}
