1. Home
  2. Servers
  3. How to Enable/Disable gzip compression in nginx on a Plesk Server

How to Enable/Disable gzip compression in nginx on a Plesk Server

This article will show you how to enable / disable Gzip compression in nginx on Plesk Server

How to Enable

 

Step 1. Log into Plesk. 

Step 2. Go to Domains> Example.com> Hosting & DNS> Apache & nginx settings.

Step 3.  Add the following directories to the Additional nginx directories field: 

gzip on;
gzip_disable "MSIE [1-6]\\.(?!.*SV1)";
gzip_proxied any;
gzip_comp_level 5;
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/rss+xml text/javascript image/x-icon image/bmp image/svg+xml;
gzip_vary on;

Note: This is an example. If needed, add other file types in the gzip_types section, E.g: application/javascript, application/js etc. The Full list of available types  can be found on a server in the files /etc/nginx/mime.types

Step 4. Apply the changes

How to Disable

Disabling gzip compression for a domain in Plesk

Step 1. Log in to Plesk. 

Step 2. Go to Domains> example.com> Hosting & DNS> Apache & nginx settings. 

Note: To disable gzip compression for a domain / subdomain that does not exist in Plesk (e.g hostname), create it first. 

Step 3. Add the following directive to the Additional nginx directives field. 

gzip off;

Step 4. Click apply to save the changes 

Updated on March 14, 2023

Was this article helpful?

Related Articles