From f80125f4a837dd7b26816dd28b5ea59cfef1df35 Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 27 May 2026 21:16:21 +0500 Subject: [PATCH] chore: add gzip and cache headers in nginx for static assets --- frontend/nginx.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index e6d92d7..6c7dde2 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -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; }