diff --git a/nginx.conf b/nginx.conf index 9e1911f..e60bfdc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -28,9 +28,10 @@ http { root /usr/share/nginx/html; index index.html; - # Servir les fichiers statiques - location / { - try_files $uri $uri/ /index.html; + # Cache pour les assets + location ~* \.(css|js|svg|png|jpg|jpeg|gif|ico)$ { + expires 1d; + add_header Cache-Control "public, immutable"; } # Proxy vers le backend Flask @@ -42,10 +43,9 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } - # Cache pour les assets - location ~* \.(css|js|svg|png|jpg|jpeg|gif|ico)$ { - expires 1d; - add_header Cache-Control "public, immutable"; + # Servir les fichiers statiques (à la fin, après les autres locations) + location / { + try_files $uri $uri/ /index.html; } } }