Skip to content

Instantly share code, notes, and snippets.

@Sargeanthost
Forked from kilhage/nginx-gzip.conf
Last active March 7, 2021 21:45
Show Gist options
  • Save Sargeanthost/d451197b46cdeb35fdbedfb62b5eda3b to your computer and use it in GitHub Desktop.
Save Sargeanthost/d451197b46cdeb35fdbedfb62b5eda3b to your computer and use it in GitHub Desktop.
gzip compression settings
#https://nginx.org/en/docs/http/ngx_http_gzip_module.html
gzip on;
gzip_comp_level 5;
gzip_vary on;
gzip_disable “msie6”;
gzip_proxied expired no-cache no-store private auth;
gzip_types
text/css
text/plain
text/xml
text/javascript
application/javascript
application/json
application/xml
font/otf
font/ttf
font/woff
font/woff2
application/vnd.ms-fontobject
image/svg+xml
image/webp
image/jpeg
image/png
image/gif
image/x-icon;
# if you serve a lot of ridiculously large text (like combined CSS) you might consider upping this slightly
gzip_buffers 16 8k;
gzip_min_length 10420;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment