Use multiple WSGI mount points in Apache with an Nginx reverse proxy
- by Thomas
I am trying to set up multiple virtual hosts on the same server with Nginx and Apache and have run into a curious configuration issue.
I have nginx is configured with a generic upstream to apache.
upstream backend {
server 1.1.1.1:8080;
}
I'm trying to set up multiple subdomains in nginx that hit different mountpoints in apache. Each would act like the following examples.
server {
listen 80;
server_name foo.yoursite.com;
location / {
proxy_pass http://backend/bar/;
include /etc/nginx/proxy.conf;
}
...
}
server {
listen 80;
server_name delta.yoursite.com;
location / {
proxy_pass http://backend/gamma/;
include /etc/nginx/proxy.conf;
}
...
}
These mountpoints are pointed at django projects, however each of the url entries are coming back prepended with the apache mountpoint path. So, if I called the django url entry for foo.yoursite.com/wiki/biz/, django appears to be returning foo.yoursite.com/bar/wiki/biz/. Similarly, if I call for the url entry for delta.yoursite.com/wiki/biz/, I get delta.yoursite.com/gamma/wiki/biz/.
Is there any way get rid of the prefix being returned on the url entries by django and apache?