Cantech Knowledge Base

Your Go-To Hosting Resource

How to Configure Gzip Compression in Nginx?

Enabling gzip compression on a per-site basis is one of the best ways to improve performance on a website while avoiding unnecessary major changes to the site’s architecture. Compressing files such as HTML, CSS, and JavaScript text files on the server reduces the data transferred to visitors. This improves page load times and improves the user experience. It also positively affects the SEO ranking as it is one of the site performance indicators.

In Plesk, you can accomplish this with the help of custom directives in the domain’s web server configuration.

Log in to your Plesk server.

From the left side menu, select the domain to which you want to enable gzip.

Click on the Apache and nginx settings.

In the bottom Additional nginx directives text box, you can enter the following:

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;

Click on OK to save.

Conclusion

Gzip compression at the site level keeps your website as lean and fast as possible for all visitors. This approach enables you to optimize individual domains without impacting the overall server settings. You can focus on specific resource management control. After you implement compression, you can check the results using GTmetrix, or you can view your browser’s developer tools and check for “Content-Encoding: gzip”.

April 6, 2026