Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple Django sites on Nginx and uWSGI?

Is it possible to run multiple Django sites on the same server using Nginx and uWSGI?

I suppose it's necessary to run multiple uWSGI instances (one for each site). I copied /etc/init.d/uwsgi to uwsgi2 and changed the port number. But, I got the following error:

# /etc/init.d/uwsgi2 start
Starting uwsgi: /usr/bin/uwsgi already running.

How is it possible to run multiple uWSGI instances?

Thanks

like image 430
Thomas Avatar asked Oct 30 '11 02:10

Thomas


1 Answers

You can create create multiple virtual hosts that allow you to host multiple sites, independent from each other. More info here: http://wiki.nginx.org/VirtualHostExample.

A bit more detailed info here as well on how to setup virtual hosts http://projects.unbit.it/uwsgi/wiki/RunOnNginx#VirtualHosting.

like image 62
Andres Ilich Avatar answered Sep 30 '22 06:09

Andres Ilich