Skip to content

Instantly share code, notes, and snippets.

@marcusshepp
Last active July 29, 2016 19:58
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 marcusshepp/effaa561b64f489872d4 to your computer and use it in GitHub Desktop.
Save marcusshepp/effaa561b64f489872d4 to your computer and use it in GitHub Desktop.
Basic Nginx Script Listen's for a Gunicorn Generated Sock File
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;
}
}
@marcusshepp
Copy link
Author

havent tested fail_timeout=0;.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment