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; }