Created
May 15, 2013 10:28
-
-
Save eddix/5583031 to your computer and use it in GitHub Desktop.
capstrino + unicorn + nginx
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
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