Skip to content

Instantly share code, notes, and snippets.

@mentholiptuz
Forked from hilios/gist:1284170
Created July 4, 2013 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mentholiptuz/5924735 to your computer and use it in GitHub Desktop.
Save mentholiptuz/5924735 to your computer and use it in GitHub Desktop.
server {
# 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)”;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$ {
expires 30d;
access_log off;
}
# location ~* \.(ico|css|js|gif|jp?g|png) {
# if ($args ~ [0-9]+) {
# expires max;
# break;
# }
# }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment