This commit is contained in:
2026-03-18 16:02:25 +07:00
parent 6b69d4f64c
commit fa98e42349
2 changed files with 28 additions and 5 deletions

View File

@@ -64,6 +64,18 @@ http {
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
# Static assets caching
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|map)$ {
proxy_pass http://frontend;
expires 365d;
add_header Cache-Control "public, immutable";
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
access_log off;
}
# Frontend
location / {
proxy_pass http://frontend;
@@ -74,6 +86,9 @@ http {
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 $scheme;
# Don't cache HTML pages
add_header Cache-Control "public, max-age=0, must-revalidate";
}
# API