How to enable/disable gzip compression in nginx on a Plesk server

Enabling gzip compression for a domain in Plesk

  1. Log in to Plesk.

  2. Go to Domains > example.com > Apache & nginx Settings.

  3. Add the following directives to the Additional nginx directives field:

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

    Note: This is an example. If needed, add other file types in the gzip_types section, e.g. application/javascriptapplication/js, etc. The full list of available types can be found on a server in the file /etc/nginx/mime.types.

  4. Apply the changes.

Disabling gzip compression for a domain in Plesk

  1. Log in to Plesk.

  2. Go to Domains > example.com > Apache & nginx Settings.

    Note: To disable gzip compression for a domain/subdomain that does not exist in Plesk (e.g. hostname), create it first.

  3. Add the following directive to the Additional nginx directives field:

    gzip off;

  4. Click Apply to save the changes.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to get/reset lost Plesk Administrator password in Plesk for Linux

Login as root.  # plesk bin admin --set-admin-password -passwd '*****' Run the command below...

How to Generate 1 Time Link for Plesk (to login without password)

For security reasons, the command to retrieve a Plesk "admin" password has been removed in Plesk...

Unknown "no_cache" variable nginx

The issue might be caused by outdated custom vhost templates created on 17.5. Plesk 17.8 brings...

How to enable HTTP/2 Support in Plesk

HTTP/2 (also known as HTTP/2.0 and HTTP 2.0) is the second major version of the HTTP network...