Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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;
location /media {
alias /opt/media;
location /static {
alias /opt/static;

This comment has been minimized.

Copy link
Owner Author

@marcusshepp marcusshepp commented Mar 16, 2016

havent tested fail_timeout=0;.

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