rewrite rule

Igor Sysoev is at rambler-co.ru
Sun Dec 26 19:38:19 MSK 2004


On Sun, 26 Dec 2004, RaPaMaN wrote:

>
> Более корректный regexp дает сразу результат в $1:
>
> ^/intranet/(.+\.(?:(?:jpg)|(?:png)|(?:gif)))$
>
> без добавления мусора или $2.

Достаточно даже так:
^/intranet/(.+\.(?:jpg|png|gif))$

>
> С Уважением,
> Дмитрий.
>
> On Sunday 26 December 2004 18:09, RaPaMaN wrote:
> > Баг с  rewrite ?
> >
> > Правило 1:
> >
> >         rewrite ^/intranet/(.+\.(jpg|png|gif))$
> >                 /$1   last;
> >
> > Результат в rewritten uri:
> >
> > 2004/12/26 10:16:26 [notice] 21331#0: *19720
> > "^/intranet/(.+\.(jpg|png|gif))$" matches
> > "/intranet/phpgwapi/templates/idots/images/vcss.png", client: 192.168.1.9,
> > URL: "/intranet/phpgwapi/templates/idots/images/vcss.png", referrer:
> > "http://www.virthost.net/intranet/login.php"
> > 2004/12/26 10:16:26 [notice] 21331#0: *19720 rewritten uri: "/", client:
> > 192.168.1.9, URL: "/intranet/phpgwapi/templates/idots/images/vcss.png",
> > referrer: "http://www.virthost.net/intranet/login.php"
> >
> >
> > Правило 2:
> >
> >         rewrite ^/intranet/(.+\.(jpg|png|gif))$
> >                 /$1s$2   last;
> >
> > Результат в rewritten uri:
> >
> > 2004/12/26 10:17:01 [notice] 21391#0: *19745
> > "^/intranet/(.+\.(jpg|png|gif))$" matches
> > "/intranet/phpgwapi/templates/idots/images/vcss.png", client: 192.168.1.9,
> > URL: "/intranet/phpgwapi/templates/idots/images/vcss.png", referrer:
> > "http://www.virthost.net/intranet/login.php"
> > 2004/12/26 10:17:01 [notice] 21391#0: *19745 rewritten uri:
> > "/phpgwapi/templates/idots/images/vcss.pngspng", client: 192.168.1.9, URL:
> > "/intranet/phpgwapi/templates/idots/images/vcss.png", referrer:
> > "http://www.virthost.net/intranet/login.php"


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





More information about the nginx-ru mailing list