server { listen 8080; server_name _; root /usr/share/nginx/html; index index.html; # Le back-end tourne dans le même pod que ce conteneur. location ~ ^/(api|admin|static)/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; proxy_read_timeout 60s; } # Fichiers versionnés par Vite : cache long. location /assets/ { try_files $uri =404; add_header Cache-Control "public, max-age=31536000, immutable"; } # Application monopage : toute autre route retombe sur index.html. location / { try_files $uri /index.html; add_header Cache-Control "no-cache"; } }