H
H
hukabuk2019-04-14 18:22:59
Django
hukabuk, 2019-04-14 18:22:59

How to set up nginx+uwsgi for multiple projects?

Let me tell you right now, it's a stupid question.
There are 2 projects on django, I set them up shorter, everything is fine - supervisor, uwsgi (I use vassals).
However, I have an error duplicate upstream "django" in ФАЙЛ_НАСТРОЕК_NGINX
. And this is because I have them really duplicated. In the first setup project:

upstream django {
      server unix://Путь №1/uwsgi_nginx.sock; # for a file socket
      # server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

# configuration of the server
server {
      # the port your site will be served on
      listen      80;
      .....

            # Finally, send all non-media requests to the Django server.
      location / {
    uwsgi_pass  django;
    include     ПУТЬ №1/uwsgi_params; # the uwsgi_params file you installed
      }
}

And for the second project:
upstream django {
      server unix://Путь №2/uwsgi_nginx.sock; # for a file socket
      # server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

# configuration of the server
server {
      # the port your site will be served on
      listen      80;
      .....

            # Finally, send all non-media requests to the Django server.
      location / {
    uwsgi_pass  django;
    include     ПУТЬ №2/uwsgi_params; # the uwsgi_params file you installed
      }

}

What is the best way for me to do, rename one of them?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question