Generally, gzip compression isn’t enabled by Nginx for serving files. If CSS and Javascript files aren’t minified or pre-compressed, gzip compression is commonly used to reduce the filesize of these files. This guide will display the way to enable it per site for a Plesk 12.5 or Onyx based server.
Instructions
- Login to your Plesk server.
- From the left hand side, select the domain that you want to enable gzip for.
- Click on Apache and nginx settings as below:
- At the bottom, add the following to the “Additional nginx directives” field:
gzip on; gzip_disable “MSIE [1-6]\.(?!.*SV1)”; gzip_proxied any; gzip_types text/plain text/css application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp image/svg+xml; gzip_vary on;
- In order to save, click on OK.
The working of gzip compression can be verified by using your browser’s debug tools or third party website such as GTMetrix.