How to Enable Gzip Compression on Plesk for Nginx


If you are using Nginx web server on your Plesk server, you can enable Gzip compression on Plesk by using the following method. Please click here to know how to enable Gzip compression on Plesk with Apache web server.


First you need to create the file gzip.conf  in /etc/nginx/conf.d/ so it become /etc/nginx/conf.d/gzip.conf using the below command

nano /etc/nginx/conf.d/gzip.conf

Then copy and paste the below command into the file and save it.

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

Test your configuration to see if everything is good using

nginx -t

If everything is fine use the below command to restart the server

/etc/init.d/nginx restart

Then use this tool to test