Enabling GZip compression on Plesk 11.5’s nginx
One of the legacy systems we still use at Flosoft.biz is Plesk. Over the last few years it has slowly gotten better (don’t worry, it still completely breaks on every version upgrade) and nowadays comes with nginx.
However, I noticed that for some obscure reason, it doesn’t enable GZip compression for the webpages it serves? This is quite odd, having myself worked a lot with nginx over the last few years, it’s a default configuration!
Don’t worry, it’s quite easy to enable it though:
Just edit the following file as root: /etc/nginx/conf.d/gzip.conf
gzip on;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/x-javascript;
gzip_vary on;
gzip_disable “msie6”;
Then run nginx -t
to test the configuration and if that’s all ok, restart nginx by running /etc/init.d/nginx restart
.
That’s it. Your webserver will now be serving your pages with GZip compression.