Skip to content

Instantly share code, notes, and snippets.

@matthiask
Created March 1, 2016 08:19
Show Gist options
  • Save matthiask/d79f8ed9638fbc0ac241 to your computer and use it in GitHub Desktop.
Save matthiask/d79f8ed9638fbc0ac241 to your computer and use it in GitHub Desktop.
server {
listen *:80;
server_name ...;
root /home/www-data/.../htdocs;
error_log /home/www-data/logs/....error.log;
access_log /home/www-data/logs/....access.log combined;
client_max_body_size 100m;
client_body_buffer_size 128k;
location /media/ {
alias /home/www-data/.../media/;
}
location /static/ {
alias /home/www-data/.../static/;
}
location / {
try_files $uri @upstream;
}
location @upstream {
proxy_pass http://unix:/home/www-data/.../tmp/gunicorn.sock;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Protocol $scheme;
client_body_buffer_size 128k;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment