Created
August 21, 2012 05:55
-
-
Save jetsgit/3412424 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx.conf | |
user deployer staff; | |
worker_processes 2; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
# multi_accept on; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
access_log /var/log/nginx/access.log; | |
sendfile on; | |
tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
tcp_nodelay on; | |
default_type application/octet-stream; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
gzip on; | |
gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | |
gzip_proxied any; | |
gzip_min_length 500; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} | |
sites-enabled/default | |
upstream aceleathergoods { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a | |
# single worker for timing out). | |
# for UNIX domain socket setups: | |
server unix:/tmp/aceleathergoods.socket fail_timeout=0; | |
} | |
server { | |
listen 80; ## listen for ipv4 | |
listen [::]:80 default ipv6only=on; ## listen for ipv6 | |
server_name aceleathergoods.net; | |
root /home/deployer/apps/aceleathergoods/current/public; | |
access_log /var/log/nginx/aceleathergoods_access.log; | |
rewrite_log on; | |
location / { | |
#all requests are sent to the UNIX socket | |
proxy_pass http://aceleathergoods; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
client_max_body_size 10m; | |
client_body_buffer_size 128k; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 90; | |
proxy_read_timeout 90; | |
proxy_buffer_size 4k; | |
proxy_buffers 4 32k; | |
proxy_busy_buffers_size 64k; | |
proxy_temp_file_write_size 64k; | |
} | |
location ~ ^/(assets)/ { | |
root /home/deployer/apps/aceleathergoods/current/public; | |
gzip_static on; # to serve pre-gzipped version | |
expires max; | |
add_header Cache-Control public; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment