Skip to content

Instantly share code, notes, and snippets.

@neurosnap
Created April 29, 2014 03:31
Show Gist options
  • Save neurosnap/11390064 to your computer and use it in GitHub Desktop.
Save neurosnap/11390064 to your computer and use it in GitHub Desktop.
upstream eaa_app_server {
server unix:/srv/www/eaa/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name eaa.neurosnap.net;
client_max_body_size 4G;
access_log /srv/www/logs/eaa/nginx-access.log;
error_log /srv/www/logs/eaa/nginx-error.log;
location /static/ {
alias /srv/www/eaa/eaa/static/;
}
location /media/ {
alias /srv/www/eaa/media/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://eaa_app_server;
break;
}
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /srv/www/eaa/eaa/static/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment