Skip to content

Instantly share code, notes, and snippets.

@qianduan
Created December 3, 2015 03:39
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 qianduan/f2668ecefade3b9ccace to your computer and use it in GitHub Desktop.
Save qianduan/f2668ecefade3b9ccace to your computer and use it in GitHub Desktop.
nginx config for performance
http {
...
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 60;
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_min_length 1000;
gzip_proxied any;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/html application/xml application/xml+rss text/javascript application/javascript;
proxy_cache_path /var/cache levels=1:2 keys_zone=qdc:300m inactive=24h max_size=2g;
proxy_temp_path /var/temp_path;
proxy_cache_key $host$uri$is_args$args;
# don't send the nginx version number in error pages and Server header
server_tokens off;
add_header X-Content-Type-Options nosniff;
// disable brower to render the page inside an frame or iframe
add_header X-Frame-Options SAMEORIGIN;
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment