Enabling gzip compression for a domain in Plesk
-
Log in to Plesk.
-
Go to Domains > example.com > Apache & nginx Settings.
-
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/javascript
,application/js
, etc. The full list of available types can be found on a server in the file/etc/nginx/mime.types
. -
Apply the changes.
Disabling gzip compression for a domain in Plesk
-
Log in to Plesk.
-
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.
-
Add the following directive to the Additional nginx directives field:
gzip off;
-
Click Apply to save the changes.