To enable compression on a Plesk server with Nginx handling static content, had to add the following to .htaccess:
1 2 3 4 5 |
<IfModule mod_deflate.c> <filesMatch "\.(js|css|html|php)$"> SetOutputFilter DEFLATE </filesMatch> </IfModule> |
This configuration is explained here: https://www.a2hosting.com/kb/developer-corner/apache-web-server/data-compression-using-the-mod-deflate-module
And then in Plesk under:
Subscriptions -> acme.com -> Websites & Domains -> Web Server Settings -> Additional nginx directives
added the following:
1 2 3 4 5 6 7 |
# enable gzip compression gzip on; gzip_min_length 1100; gzip_buffers 4 32k; gzip_types text/plain application/javascript application/x-javascript text/xml text/css; gzip_vary on; # end gzip configuration |
The Nginx configuration is explained here: http://www.nginxtips.com/how-to-configure-nginx-gzip-compression/