ПРОЕКТЫ 


  АРХИВ 


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


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: помогите переделать правило rewrite
  • From: "Denis Kot" <denis.kot@xxxxxxxxx>
  • Date: Fri, 16 May 2008 17:03:52 +0300
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=iwx4dZYuBqoueuD4CZSTRpMyAZ56eRyciQgq//buTCQ=; b=v1+vH8mKS4lxUwa8TEpfVRO8zigXNfdd3yrLx3Bro51O/54RF8bm1+WxBtSj9ruPfKlyOk5FCN5CWcpZs5bDLnu0AvWKSEvHQkI14rVpcO1OwDjIlDDyV6Wo05OmM5QzVyBo6yYAFAkcQIMSK27kX+3BwMwXTKTqgXrnRH3A9t4=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Q9EMY9YDIe8Af0MNIsU2Ot2OCil8TccHBnqfeqPAAdcAs6zUQMHFgQwmajL761XLK15hr4rTO7L3hkzmIeoTLk46Uzl7VQVknkRoQypfrs8Hv/XbmGFYXChWIpOo+nd1aFsTtx9H+ZMP2KtxmaPEoh0Gu1ZPsKNMX8jzhOEevdE=
  • In-reply-to: <482D906D.1060102@xxxxxxxxx>
  • References: <3cfad9ca0805160454r7b8c35d9qf17463869368664@xxxxxxxxxxxxxx> <3cfad9ca0805160529w5eb3630fj95e1d93b1e4c3905@xxxxxxxxxxxxxx> <482D906D.1060102@xxxxxxxxx>

про php это понятно.
уже вроде как заработало.
вот что вышло:
    location  /forum/torrentbar/ {
        rewrite
^/forum/torrentbar/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
/forum/torrentbar/torrentbar.ph$
        rewrite
^/forum/torrentbar/(.*)/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
/forum/torrentbar/torrentb$
        rewrite ^/forum/torrentbar/(.*)/([0123456789]*)\.png$
/forum/torrentbar/torrentbar.php?id=$2 last;
        rewrite ^/forum/torrentbar/([0123456789]*)\.png$
/forum/torrentbar/torrentbar.php?id=$1 last;
    }

2008/5/16 Sergey Shepelev <temotor@xxxxxxxxx>:
> У nginx нет mod_php. Нужно настраивать FastCGI бекенд.
>
> Регекспы можно упростить до (\d*)-([\d\w_]*)
> хотя могу и ошибаться с регекспами.
>
> Denis Kot пишет:
>>
>> хм, вроде начало отрабатывать, но теперь в огнелисе предлагает
>> сохранить файл, а в IE возвращает код php.
>>
>> 16 мая 2008 г. 14:54 пользователь Denis Kot <denis.kot@xxxxxxxxx> написал:
>>>
>>> есть вот такой вот .htaccess
>>> RewriteRule
>>> ^([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>>> torrentbar.php?id=$1&style=$2 [L]
>>> RewriteRule
>>> ^(.*)/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>>> torrentbar.php?id=$2&style=$3 [L]
>>>
>>> RewriteRule ^(.*)/([0123456789]*)\.png$ torrentbar.php?id=$2 [L]
>>> RewriteRule ^([0123456789]*)\.png$ torrentbar.php?id=$1 [L]
>>>
>>> попробывал сделать так:
>>>   location /forum/torrentbar/ {
>>>       rewrite
>>>
>>> ^/forum/torrentbar/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>>> /forum/torrentbar/torrentbar.php?id=$1&style=$2 break;
>>>       rewrite
>>>
>>> ^/forum/torrentbar/(.*)/([0123456789]*)-([0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_]*)\.png$
>>> /forum/torrentbar/torrentbar.php?id=$2&style=$3 break;
>>>   }
>>>
>>> в логах:
>>> 2008/05/16 16:48:01 [error] 8779#0: *15237 open()
>>> "/home/sites/site.by/www/forum/torrentbar/3-default_cyan.png" failed
>>> (2: No such file or directory), client: 1.2.22.22, server: site.by,
>>> URL: "/forum/torrentbar/3-default_cyan.png", host: "site.by"
>>> в браузере просто белая пустая страница
>>>
>>> --
>>> Denis Kot
>>> denis?jabber.org.by
>>> ICQ: 13680126
>>> Mobil: +375 29 6-1234-78
>>>
>>
>>
>>
>
>



-- 
Denis Kot
denis?jabber.org.by
ICQ: 13680126
Mobil: +375 29 6-1234-78


 




Copyright © Lexa Software, 1996-2009.