Hello!
On Wed, Sep 28, 2011 at 12:05:07PM -0400, csg wrote:
> Maxim Dounin Wrote:
> -------------------------------------------------------
> > Errors suggest you don't have $backend set, and
> > resulting
> > proxy_pass tries to go to "http://" which is
> > invalid.
>
> Yup, I am just curious how to accomplish that if you want to perform
> some rewriting before, for example to strip off some leading parts of
> the URL path. I came up with following test case:
[...]
> location / {
> rewrite ^/foo/(.*)$ /$1 break;
The "break" here will stop execution of rewrite module directives
(including "set" below) on match.
>
> resolver 127.0.0.1;
>
> set $backend "localhost:90";
This "set" won't be executed due to break above...
> proxy_pass http://$backend;
.... and $backend won't be set as a result. Moving "set" before
"rewrite .. break" will do the trick.
Maxim Dounin
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx