Skip to content

Instantly share code, notes, and snippets.

@eddix
Created May 15, 2013 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eddix/5583031 to your computer and use it in GitHub Desktop.
Save eddix/5583031 to your computer and use it in GitHub Desktop.
capstrino + unicorn + nginx
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