Knowledgebase

How to Enable HTTP/2 and Gzip Compression in Nginx Print

  • 0

Dramatically speed up page delivery by compressing text assets and multiplexing streams.

Step-by-Step Instructions

  1. Add http2 to your listen 443 ssl directive.
  2. Enable gzip on; with common MIME types in /etc/nginx/nginx.conf.
  3. Test with nginx -t and reload.
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/javascript text/xml;

Pro Tip: Verify compression using curl -H 'Accept-Encoding: gzip' -I https://yourdomain.pk.

Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.


Was this answer helpful?

« Back