Skip to content

Instantly share code, notes, and snippets.

@loe
Created February 7, 2014 00:33
Show Gist options
  • Save loe/8855367 to your computer and use it in GitHub Desktop.
Save loe/8855367 to your computer and use it in GitHub Desktop.
daemon off;
user andrew staff;
worker_processes 1;
events {
worker_connections 256;
}
error_log /usr/local/var/log/nginx/error.log notice;
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'"$request_time" "$upstream_response_time"';
access_log /usr/local/var/log/nginx/access.log main;
# Limit requests to 2GB
client_max_body_size 2G;
recursive_error_pages on;
# Remove Archive Headers
more_clear_headers 'X-Archive-Files';
# Compression
gzip on;
gzip_http_version 1.0;
gzip_comp_level 5;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype application/json;
# 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;
# Keep-Alive for only 1 minute, same as ELB.
# Second parameter sets Keep-Alive header.
keepalive_timeout 60 60;
# Accomodate the very long server names that house custom-domains.
server_names_hash_bucket_size 128;
# Proxy Settings
proxy_buffering on;
proxy_temp_path /data/nginx_tmp;
log_subrequest on;
include servers/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment