Nginx conf:
server {
listen 80;
server_name www.test1.com;
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/test.sock;
uwsgi_param UWSGI_PYHOME /var/www/test1;
uwsgi_param UWSGI_CHDIR /var/www/test1;
uwsgi_param UWSGI_MODULE app;
uwsgi_param UWSGI_CALLABLE application;
}
}
server {
listen 80;
server_name www.test2.com;
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/test.sock;
uwsgi_param UWSGI_PYHOME /var/www/test2;
uwsgi_param UWSGI_CHDIR /var/www/test2;
uwsgi_param UWSGI_MODULE app;
uwsgi_param UWSGI_CALLABLE application;
}
}
uWSGI config:
[uwsgi]
socket = /tmp/test.sock
chmod-socket = 666
processes = 1
master = true
vhost = true
/var/www/test1/app.py:
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
return "Hello Test1!
/var/www/test2/app.py:
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
return "Hello Test2!
This config will only display the first site that you go to. If you change
the name of /var/www/test2/wsgi.py to something else, both site work fine.
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi