Hi guys! I have a Django app under WF's Apache that serves multiple Clients based on subdomains.
The process it's the following:
1) subdomain1.domain.com has its own VirtualHost entry in http.conf and it's a subdomain under domain.com
e.g:
<VirtualHost *>
ServerName subdomain1.domain.com
ServerAlias www.subdomain1.domain.com
WSGIProcessGroup ironweb
WSGIScriptAlias / /home/xxxx/webapps/xxxx/xxxx/xxx/wsgi_NNN.py
</VirtualHost>
2) Each subdomain routes to a wsgi_NNN.py file where it has some params like:
os.environ['ID'] = '1'
os.environ['DB'] = 'db_NNN'
os.environ['DIR'] = 'NNN'
3) Finally Django runs, connect and use a DB depending on the subdomain call.
How can I achieve this using uWSGI ??
I'm trying to do this with uWSGI's Emperor mode and it's Vassals, but is working with only one subdomain.
Here's the uswgi.ini :
[uwsgi]
master = True
http = 127.0.0.1:12257
daemonize = /home/nnn/logs/apps/ironweb_prueba/uwsgi.log
pidfile = /home/nnn/apps/ironweb_prueba/tmp/uwsgi.pid
emperor = %dvassals.d/*.ini
route-host = ^ironweb.nnn.opalstacked\.com$ uwsgi:/home/nnn/apps/ironweb_prueba/tmp/domain1.sock,0,0
route-host = ^nnn.opalstacked\.com$ uwsgi:/home/nnn/apps/ironweb_prueba/tmp/domain2.sock,0,0
and domain1.conf:
[uwsgi]
pidfile = /home/nnn/apps/ironweb_prueba/tmp/domain2.pid
uwsgi-socket = /home/nnn/apps/ironweb_prueba/tmp/domain2.sock
virtualenv = /home/nnn/apps/ironweb_prueba/env/
workers = 1
threads = 2
# adjust the following to point to your project
python-path = /home/nnn/apps/ironweb_prueba/IronWeb
wsgi-file = /home/nnn/apps/ironweb_prueba/IronWeb/ggcontable/wsgi_prueba.py
touch-reload = /home/nnn/apps/ironweb_prueba/IronWeb/ggcontable/wsgi_prueba.py
Any ideas? (sorry for the lenght of the msg)