Knowledgebase

How to Enable gzip Compression for Nginx Per Site? Print

  • Apache, gzip, CSS, JavaScript
  • 0

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

  1. Login to your Plesk server.
  2. From the left hand side, select the domain that you want to enable gzip for.
  3. Click on Apache and nginx settings as below:
  4. 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;

  5. 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.


Was this answer helpful?
Back