How to Enable Gzip Compression

This article is out-of-date!
Please see "Gzip Compression is Enabled by Default" for an updated article.

To enable gzip compression, create the file:


with the following contents:

gzip          on;
# text/html does not need to be listed as it is always included by nginx
gzip_types    text/plain text/css application/json application/x-javascript
              text/xml application/xml application/xml+rss text/javascript
gzip_vary     on;

Then, restart Nginx by running this command as root:

sudo service nginx-sp restart