ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rewrite rule



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




 




Copyright © Lexa Software, 1996-2009.