Reverse proxy and URL rewrite

Maxim Dounin mdounin at mdounin.ru
Sun Apr 12 05:04:28 MSD 2009


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 Dounin





More information about the nginx mailing list