Source

copelco / services / templates / nginx.conf

Full commit
upstream django_server {
    server 127.0.0.1:%(server_port)s fail_timeout=0;
}

server {
    listen 80;
    client_max_body_size 4G;

    keepalive_timeout 5;

    access_log %(log_dir)s/access.log;
    error_log %(log_dir)s/error.log;

    location /media/ {
        alias /home/copelco/www/production/uploads/;
    }

    location /static {
        root %(code_root)s;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_buffering on;

        if (!-f $request_filename) {
            proxy_pass http://django_server;
            break;
        }

    }
}