Skip to content

Instantly share code, notes, and snippets.

@vanjor
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save vanjor/b355d474a08b02d77d14 to your computer and use it in GitHub Desktop.

Select an option

Save vanjor/b355d474a08b02d77d14 to your computer and use it in GitHub Desktop.
Nginx config snippets
# define a new log_format which support logging requestion_time and transter time
log_format combinedio '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_length $request_time $upstream_response_time';
http {
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 2;
# support to gzip transfer js,txt,png,etc.some js, need both application/javascript and application/x-javascript to fix some compatibility problems
# detail refer:http://www.webkaka.com/blog/archives/how-to-set-gzip-for-js-in-Nginx.html
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_disable "MSIE [1-6].";
# support move all site conf into sub folders
include include/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment