Proxy passing and the URI

mike mike503 at
Tue Sep 23 18:08:49 MSD 2008

On Tue, Sep 23, 2008 at 1:52 AM, Maxim Dounin <mdounin at> wrote:

>    location ^~ /sites {
>        proxy_pass;
>    }
> the '/sites' part will be removed.

Weird, so that missing "/" at the end would have fixed my issue? I
-think- on a quick check it has. I thought I tried that earlier and it
didn't help!

> See for details.
> 2. Modify uri as needed with rewrite before proxy_pass.  This less efficient
> but may be used where 1 can't be (e.g. in regex locations).  E.g.
>    location ~ ^/sites.*\.cgi$ {
>        rewrite  ^/sites(.*)  $1  break;
>        proxy_pass http://backend;
>    }

Yeah, I've tried this before too, executing rewrites before the
location block and such. I can't really do it here - I could do it
-inside- of the location block however, if needed. This current host
supports a ton of other rewrites and it could get confusing and/or
break something if I did any more rewrites outside of the location

Thanks Maxim!

More information about the nginx mailing list