chore: add gzip and cache headers in nginx for static assets

This commit is contained in:
Admin
2026-05-27 21:16:21 +05:00
parent 627ae8e4d3
commit f80125f4a8
+15
View File
@@ -4,6 +4,21 @@ server {
root /usr/share/nginx/html;
index index.html;
# Gzip compression for text assets
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
# Cache static assets aggressively
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, immutable";
access_log off;
}
location / {
try_files $uri $uri/ /index.html;
}