A maneira que eu resolvi esse problema é ter o proxy reverso nginx em todos os sites, mas tê-los ir para diferentes hosts virtuais do apache ouvindo em portas diferentes.
nginx (em / etc / nginx)
proxy.conf
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k; proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
/ etc / nginx / sites-enabled / default
server {
listen 80;
server_name django-site.com;
location / {
proxy_pass http://127.0.0.1:8085;
include /etc/nginx/proxy.conf;
}
}
server {
listen 80;
server_name regular-site.com;
location / {
proxy_pass http://127.0.0.1:8086;
include /etc/nginx/proxy.conf;
}
}
Configurações do Apache / etc / apache2 / sites-enabled
django-site
NameVirtualHost 127.0.0.1:8085
<VirtualHost 127.0.0.1:8085>
ServerName django-site.com
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonOption django.root
PythonDebug On
PythonPath "['/django/django-site'] + sys.path"
</Location>
</VirtualHost>
site regular
NameVirtualHost 127.0.0.1:8086
<VirtualHost 127.0.0.1:8086>
ServerName regular-site.com
ServerAlias regular-site.com
ServerAdmin [email protected]
DocumentRoot /var/www/regular-site/
</VirtualHost>
No /etc/apache2/apache2.conf
# Include ports listing
Include /etc/apache2/ports.conf
o ports.conf deve listar todas as portas /etc/apache2/ports.conf
#Listen 80
#disabled for nginx
Listen 8085
Listen 8086
<IfModule mod_ssl.c>
Listen 443
</IfModule>