Skip to content

Instantly share code, notes, and snippets.

@champierre
Last active December 23, 2015 19:09
Show Gist options
  • Save champierre/6680878 to your computer and use it in GitHub Desktop.
Save champierre/6680878 to your computer and use it in GitHub Desktop.
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
upstream unicorn {
server unix:/tmp/unicorn.[app].sock fail_timeout=0;
}
server {
listen 80 default deferred;
root [app_home]/public;
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unicorn;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment