Skip to content

Instantly share code, notes, and snippets.

@ibrahim12
Last active August 29, 2015 13:57
Show Gist options
  • Save ibrahim12/9563312 to your computer and use it in GitHub Desktop.
Save ibrahim12/9563312 to your computer and use it in GitHub Desktop.
Nginx config
upstream project_name {
server unix:/web/nginx/sites/site-a.com/application/project_name/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name projects.site-a.com;
client_max_body_size 4G;
access_log /web/nginx/sites/site-a.com/application/project_name/logs/nginx-access.log;
error_log /web/nginx/sites/site-a.com/application/project_name/logs/nginx-error.log;
location /static/ {
alias /web/nginx/sites/site-a.com/application/project_name/static/;
}
location /media/ {
alias /web/nginx/sites/site-a.com/application/project_name/media/;
}
location /project_name {
proxy_set_header SCRIPT_NAME /project_name;
proxy_set_header Host $http_host;
proxy_redirect off;
# proxy_buffering off;
if (!-f $request_filename) {
proxy_pass http://project_name;
break;
}
}
# Error pages
error_page 500 502 503 504 /500.html;
location = /500.html {
root /web/nginx/sites/site-a.com/application/project_name/static/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment