Skip to content

Instantly share code, notes, and snippets.

@barkerja
Forked from eddix/nginx.conf
Created April 10, 2014 01:31
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 barkerja/10335730 to your computer and use it in GitHub Desktop.
Save barkerja/10335730 to your computer and use it in GitHub Desktop.
upstream mostor_backend {
server unix:/tmp/unicorn.mostor-website.sock fail_timeout=0;
}
server {
listen 80;
root /home/work/www/mostor/current/public/;
client_max_body_size 1000m;
location ^~ /assets/ {
gzip_static on;
access_log off;
expires max;
add_header Cache-Control public;
}
location / {
try_files $uri/index.html $uri @unicorn;
}
location @unicorn {
proxy_redirect off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
proxy_pass http://mostor_backend;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment