Use multiple WSGI mount points in Apache with an Nginx reverse proxy
Posted
by Thomas
on Stack Overflow
See other posts from Stack Overflow
or by Thomas
Published on 2010-04-05T22:06:41Z
Indexed on
2010/04/05
22:13 UTC
Read the original article
Hit count: 560
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?
© Stack Overflow or respective owner