Welcome! Log In Create A New Profile

Advanced

Re: bugs: try_files & if, add_header

Denis F. Latypoff
October 16, 2009 10:02AM
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@gostats.ru
Subject Author Posted

bugs: try_files & if, add_header

Aleksander October 16, 2009 09:38AM

Re: bugs: try_files & if, add_header

Igor Sysoev October 16, 2009 09:48AM

Re[2]: bugs: try_files & if, add_header

Aleksander October 16, 2009 10:02AM

Re: bugs: try_files & if, add_header

Maxim Dounin October 16, 2009 10:02AM

Re[2]: bugs: try_files & if, add_header

Aleksander October 16, 2009 10:32AM

Re: bugs: try_files & if, add_header

Maxim Dounin October 16, 2009 12:34PM

Re[2]: bugs: try_files & if, add_header

Aleksander October 16, 2009 01:02PM

Re: bugs: try_files & if, add_header

Denis F. Latypoff October 16, 2009 10:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 110
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready