Reverse proxy and URL rewrite

Hi all,
I have a Python twisted server running behind nginx.

The twisted server expects to be deployed to serve results relative to /
However, I actually want it deployed at /buildbot.

Is there a way to mangle the request URL on its way through a proxy, so
that I can strip out the “/buildbot”?

Thanks,
James

Posted at Nginx Forum: Reverse proxy and URL rewrite

Hello!

On Sat, Apr 11, 2009 at 08:44:56PM -0400, gefafwisp wrote:

Hi all,
I have a Python twisted server running behind nginx.

The twisted server expects to be deployed to serve results relative to /
However, I actually want it deployed at /buildbot.

Is there a way to mangle the request URL on its way through a proxy, so that I can strip out the “/buildbot”?

location /buildbot/ {
    proxy_pass http://your-backend-address/;
}

Note the trailing ‘/’ in proxy_pass, it’s uri component that will
replace part of uri matched by location.

Maxim D.

location /buildbot/ {
proxy_pass http://your-backend-address/;
}

Great, that’s got it - thanks!

Posted at Nginx Forum: Re: Reverse proxy and URL rewrite