0

My question is how can I use one domain (mydomain.com) to build multiple django server?

This is my nginx.conf,

upstream django_myproject {
    server unix:///home/frank/myproject/haunyu.sock; # for a file socket
}

server {
    listen      80;
    server_name mydomain.com; # This is my ow
    charset     utf-8;
    client_max_body_size 75M;   # adjust to taste
    # Django media
    location /media  {
        alias /home/frank/myproject/media;  
    }
    location /static {
    alias /home/frank/myproject/static;
}
location / {
    uwsgi_pass  django_myproject;
    include     /home/frank/myproject/uwsgi_params; # 
    uwsgi_read_timeout 600;
    }
}

I try to let location "/" replace to location "/first_app" like this

location /frist_app {
    uwsgi_pass  django_myproject;
    include     /home/frank/myproject/uwsgi_params; # 
    uwsgi_read_timeout 600;
    }
}

Then I try to type domain/frist_app to browser, I got 404, My uwsgi also has no contact message.

Frank Liao
  • 855
  • 1
  • 8
  • 25
  • Check the access log. You should see the sequence of requests that finish with the 404 response. – Richard Smith Oct 06 '17 at 08:57
  • Why not put it under a subdomain like firstapp.mydomain.com? In you're attempt you'll and up writing workarounds in the urls.py and probably more places. Otherwise this may [help](https://stackoverflow.com/questions/15353935/correct-proxy-path-in-nginx-conf). – DA-- Oct 06 '17 at 11:02
  • Subdomain is much easier to achieve then a different base url – Tarun Lalwani Oct 06 '17 at 20:51

0 Answers0