Proxy passing and the URI

mike mike503 at gmail.com
Tue Sep 23 09:31:02 MSD 2008


I have a request for http://foo.com/sites/something

I have this location block inside of server{} with root /home/foo/web/foo.com

location ^~ /sites {
   proxy_pass http://10.122.47.82;
   proxy_set_header Host foo.com;
}

Trying to pass it to a second server.

The problem is, the second server receives this as the full URI; I
have to define "root" to be the base URI (/home/foo/web/foo.com) so
the /sites/something maps to it properly. Is there any way to remove
parts of the URI when passing via proxy? So the /sites/something/
isn't needed on the upstream server?

Thanks





More information about the nginx mailing list