Try Now

How to enable GZIP on Nginx

Nginx, unlike Apache, does not have a directory-level configuration for GZIP compression. This means that SpeedyCache cannot automate the process of enabling GZIP compression for your website. Instead, you will need to manually add the relevant configuration to your Nginx configuration file.
To enable GZIP on Nginx follow the steps below:-

  • Look for Nginx config file at  /etc/nginx/nginx.conf
  • In that file paste the following code inside http block, and in case gzip is already configured then replace that configuration.

gzip on;

gzip_vary on;

gzip_proxied any;

gzip_comp_level 6;

gzip_buffers 16 8k;

gzip_http_version 1.1;

gzip_types image/svg+xml text/plain text/html text/xml text/css text/javascript application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript application/x-font-ttf application/vnd.ms-fontobject font/opentype font/ttf font/eot font/otf;

After saving this configuration restart your Nginx server and then GZIP will start working on your website.

In case you face any issues feel free to contact our support, we would be glad to help. You can contact us at support@speedycache.com

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list