Last active
September 26, 2015 16:28
-
-
Save lorn/1126172 to your computer and use it in GitHub Desktop.
Uma arquitetura de alta disponibilidade usando Starman
This file contains hidden or 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 myapp_starman { | |
server unix:/tmp/starman.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
client_max_body_size 1024m; | |
client_body_buffer_size 8k; | |
proxy_read_timeout 300; | |
## | |
# basic | |
## | |
server_name www.localhost.com; | |
root /home/user/MyApp/root; | |
keepalive_timeout 0; | |
## | |
# logging | |
## | |
access_log /var/log/nginx/myapp.access combined; | |
error_log /var/log/nginx/myapp.error; | |
location /static { | |
root /home/user/MyApp/root/; | |
autoindex on; | |
} | |
## | |
# proxy | |
## | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_buffering off; | |
if (!-f $request_filename) { | |
proxy_pass http://myapp_starman; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment