Skip to content

Instantly share code, notes, and snippets.

@chrismeller
Created February 9, 2013 04:04
Show Gist options
  • Select an option

  • Save chrismeller/4743781 to your computer and use it in GitHub Desktop.

Select an option

Save chrismeller/4743781 to your computer and use it in GitHub Desktop.
# disable compression on old IE versions
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# compress proxied requests too
gzip_proxied any;
gzip_types
text/css
text/plain
text/javascript
application/javascript
application/json
application/x-javascript
application/xml
application/xml+rss
application/xhtml+xml
application/x-font-ttf
application/x-font-opentype
application/vnd.ms-fontobject
image/svg+xml
image/x-icon
application/rss+xml
application/atom_xml;
gzip_comp_level 9;
# we want to gzip http 1.0 requests, too, so lower the level required
gzip_http_version 1.0;
# set the Vary: Accept-Encoding header to force proxies to store compressed and uncompressed versions
gzip_vary on;
# increase the size of the buffers to make sure large content can be compressed too
gzip_buffers 16 8k;
# up the minimum length a little to account for gzip overhead
gzip_min_length 50;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment