is there a way to change $uri variable?

Igor Sysoev igor at sysoev.ru
Thu Nov 26 11:52:21 MSK 2009


On Thu, Nov 26, 2009 at 09:46:30AM +0100, Nanyang Zhan wrote:

> In .conf file, is there a way to change $uri variable?
> 
> I want to do something like:
> try_files ${uri}.sub(/test$/, "dev") @mongrel
> 
> I know there is rewrite function, but I do not use it because I want to
> keep the original $uri value to the @mongrel section.

Try

    location ~ ^(/.+)test$ {
        try_files  $1dev   @mongrel;
    }


-- 
Igor Sysoev
http://sysoev.ru/en/




More information about the nginx mailing list