rebours/nginx.conf
2026-02-27 18:36:09 +01:00

38 lines
968 B
Nginx Configuration File

server {
listen 80;
server_name rebours.studio;
root /var/www/html/rebours/dist;
index index.html;
# HTML : jamais caché
location ~* \.html$ {
add_header Cache-Control "no-store";
}
# Fichiers Astro avec hash dans _astro/ : cache long immutable
location ~* ^/_astro/ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
# CSS / JS sans hash (style.css, main.js) : revalidation à chaque visite
location ~* \.(css|js)$ {
add_header Cache-Control "no-cache";
}
# Assets (images, fonts) : cache 7 jours
location ~* \.(jpg|jpeg|png|gif|webp|svg|woff2|woff|ttf|ico)$ {
add_header Cache-Control "public, max-age=604800";
}
location / {
try_files $uri $uri/ $uri.html /index.html;
}
location /api/ {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}