Files

23 lines
647 B
Nginx Configuration File

server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# SPA (react-router BrowserRouter) : toute route inconnue renvoie index.html
# Sans ça, un rafraîchissement ou un lien direct vers /login, /logs, etc. renvoie 404.
location / {
try_files $uri $uri/ /index.html;
}
# Assets hashés par Vite : cache immuable d'un an
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
gzip on;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
gzip_min_length 1024;
}