| Nginx-ru mailing list archive (nginx-ru@sysoev.ru) [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
 Re: bugs: try_files & if, add_header
 
To: Aleksander <nginx-ru@xxxxxxxxx>Subject: Re: bugs: try_files & if, add_headerFrom: "Denis F. Latypoff" <denis@xxxxxxxxxx>Date: Fri, 16 Oct 2009 20:53:27 +0700Domainkey-signature: a=rsa-sha1; h=Received:Date:From:X-Mailer:Organization:X-Priority:Message-ID:To:Subject:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=RFrxKRAXh+1RCDCVTZ4OrdRJ7s6u84kFjYHpNr5LcLk3jY4N8MJ+8arjOaV16tB4nx2k4TSala8KGENNG9UrGmdEBspFC8U3w6NXCFatVRkiz9iK2pPKcT2VLg5CcuVw; c=nofws; d=gostats.ru; q=dns; s=defaultIn-reply-to: <E1Mymtv-0005fi-00.jjjx128-mail-ru@xxxxxxxxxxx>Organization: GoStats.RUReferences: <E1Mymtv-0005fi-00.jjjx128-mail-ru@xxxxxxxxxxx> 
 Hello Aleksander,
Friday, October 16, 2009, 8:31:23 PM, you wrote:
> Здравствуйте.
> Есть пару проблем. 
> Первая: не совсем работает try_files.
> Есть такие файлы:
> % find /tmp/test -type f
> /tmp/test/hot/file2.txt
> /tmp/test/file1.txt
[...]
>     server {
>         listen 99;
>         root /tmp/test;
>         location / {
>             try_files /hot$uri $uri =404;
>             if ($uri ~* \.txt$) {
>             }
>         }
>     }
> Отдает 404 на второй файл, как будто директивы try_files вообще нет.
Насколько я помню - это known issue. Вот вам и демонстрация того,
почему лучше не использовать if, там где без него можно обойтись:
         location / {
             try_files /hot$uri $uri =404;
         }
         location ~* \.txt$ {
             ...
         }
-- 
Best regards,
 Denis                            mailto:denis@xxxxxxxxxx
 |