Overview

By default, Nginx doesn't enable gzip compression for serving files. This is commonly used to reduce the filesize of CSS and Javascript files, if they haven't been minified or pre-compressed. This guide will show you how to enable it per site for a Plesk 12.5 or Onyx based server.

Note: All Conetix subscriptions (shared and VPS hosting) already have gzip enabled for all sites.

Instructions

  1. Login to your Plesk server.
  2. Select the domain you wish to enable gzip for from the left hand side.
  3. Click in Apache and nginx settings:
    plesk - nginx - enable gzip compression
  4. Down 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. Click OK to save.

You can verify that gzip is working by using your browser's debug tools or a third party website such as GTMetrix.

Was this article helpful?

Related Articles