Need help? Call us on 1300 789 260

Enable gzip compression for Nginx per site

Difficulty: Intermediate

Prerequisites

Access to your Plesk login

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 based server.

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? Yes No
👥

Having trouble? We’re here to help!

We’ve built our company with a serious focus on quality service. Feel free to give us a call!

1300 789 260