Simple Rewrite Question

Igor Sysoev is at rambler-co.ru
Fri Jan 16 15:20:11 MSK 2009


On Fri, Jan 16, 2009 at 11:11:29AM +0000, Alan Williamson wrote:

> I think i blundered upon the solution myself:
> 
>         location ~* /$ {
>                 rewrite (.*) $1index.cfm;
>                 proxy_pass http://beta.yourli.st;
>         }
> 
>         location / {
>                 proxy_pass http://beta.yourli.st;
>         }
> 
> This does indeed do the trick; what i was missing the "~* /$" in the
> location directive.
> 
> Is there a more efficient way of doing this?

You may also try
 
         location / {
             proxy_pass http://beta.yourli.st;
         }

         location ~* /$ {
             proxy_pass http://beta.yourli.st${uri}index.cfm$is_args$args;
         }


-- 
Игорь Сысоев
http://sysoev.ru





More information about the nginx mailing list