Gzip compression reduces response sizes by 60-80%, improving page load times.
Enable in nginx.conf
Edit /etc/nginx/nginx.conf and add inside the http block:
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types
text/plain
text/css
text/javascript
application/javascript
application/json
application/xml
image/svg+xml
font/woff2;Test
nginx -t
systemctl reload nginxVerify
curl -H "Accept-Encoding: gzip" -I https://example.comLook for Content-Encoding: gzip in the response headers.