rewrite rule

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


On Sun, 26 Dec 2004, 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"

В данном случае должно работать такое:

         rewrite ^/intranet/(.+\.)(jpg|png|gif)$  /$1$2   last;

Почему не работает "(.+\.(jpg|png|gif))", нужно смотреть, возможно, это
проблема PCRE, а может, и nginx'а.


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





More information about the nginx-ru mailing list