gzip compression with nginx
As you may know, nginx is a fairly new web server alternative to Apache and rapidly gaining popularity with Rails implementations
Starting with Ezra’s nginx config, I noticed that gzip compression was set to be on for all browsers.
However, this is incorrect as older versions of IE (before IE SP1) do not properly handle gzip compression. Additionally, with the use of larger javascript and CSS files now, the default config configuration may not be sufficient.
The following changes should address these issues. Please let me know if you have any questions.
# output compression saves bandwidth
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# make sure gzip does not lose large gzipped js or css files
# see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl
gzip_buffers 16 8k;
# Disable gzip for certain browsers.
gzip_disable “MSIE [1-6].(?!.*SV1)”;