Skip to content

Instantly share code, notes, and snippets.

@Paxa

Paxa/nginx.conf Secret

Created Oct 21, 2012
Embed
What would you like to do?
Nginx compression and chache
gzip on;
gzip_http_version 1.0;
gzip_comp_level 9;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/css application/x-javascript text/html text/xml application/xml application/xml+rss text/javascript;
# Some version of IE 6 don't handle compression well on some mime-types, so just disable for them
gzip_disable "MSIE [1-6].(?!.*SV1)";
# Set a vary header so downstream proxies don't send cached gzipped content to IE6
gzip_vary on;
if ($request_method !~ ^(GET|HEAD|PUT|POST|DELETE|OPTIONS)$ ){
return 405;
}
location ~ ^/(assets|images|stylesheets|swfs|system)/ {
expires max;
add_header Cache-Control public;
}
location = /favicon.ico {
expires max;
add_header Cache-Control public;
}
location ~ \.php$ {
deny all;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.