rebours/nginx.conf
2026-02-27 18:14:08 +01:00

33 lines
798 B
Nginx Configuration File

server {
listen 80;
server_name rebours.studio;
root /var/www/rebours/dist;
index index.html;
# HTML : jamais caché
location ~* \.html$ {
add_header Cache-Control "no-store";
}
# CSS / JS avec hash Astro : cache long immutable
location ~* \.(css|js)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
# Assets (images, fonts) : cache long
location ~* \.(jpg|jpeg|png|gif|webp|svg|woff2|woff|ttf)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
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;
}
}