Last active
July 29, 2016 19:58
-
-
Save marcusshepp/effaa561b64f489872d4 to your computer and use it in GitHub Desktop.
Basic Nginx Script Listen's for a Gunicorn Generated Sock File
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 app_server { | |
server unix:/opt/proc/mysite-gunicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $server_name; | |
proxy_redirect off; | |
proxy_pass http://app_server; | |
break; | |
} | |
location /media { | |
alias /opt/media; | |
} | |
location /static { | |
alias /opt/static; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
havent tested
fail_timeout=0;
.