Skip to content

Instantly share code, notes, and snippets.

@ariedov
Created December 4, 2017 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariedov/c6b66de620530c87d5e94b534503c5af to your computer and use it in GitHub Desktop.
Save ariedov/c6b66de620530c87d5e94b534503c5af to your computer and use it in GitHub Desktop.
upstream getmanstudio_server {
server unix:/home/david/getman-studio-django/run/gunicorn.sock fail_timeout=0;
}
upstream getmanstudiodev_server {
server unix:/home/david/getman-studio-dev/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.getmanstudio.com;
client_max_body_size 4G;
access_log /home/david/getman-studio-django/logs/nginx-access.log;
error_log /home/david/getman-studio-django/logs/nginx-error.log;
location /static/ {
alias /home/david/getman-studio-django/getman_studio/staticfiles/;
}
location /media/ {
alias /home/david/getman-studio-django/getman_studio/media/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
# proxy_buffering off;
if (!-f $request_filename) {
proxy_pass http://getmanstudio_server;
break;
}
}
}
server {
listen 80;
server_name dev.getmanstudio.com;
client_max_body_size 4G;
access_log /home/david/getman-studio-dev/logs/nginx-access.log;
error_log /home/david/getman-studio-dev/logs/nginx-error.log;
location /static/ {
alias /home/david/getman-studio-dev/getman_studio/staticfiles/;
}
location /media/ {
alias /home/david/getman-studio-django/getman_studio/media/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
# proxy_buffering off;
if (!-f $request_filename) {
proxy_pass http://getmanstudiodev_server;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment