6 messages in ru.sysoev.nginxRe: try_files problem
FromSent OnAttachments
holstebmJul 27, 2009 10:43 pm 
Maxim DouninJul 28, 2009 1:58 am 
Maxim DouninJul 28, 2009 2:12 am 
holstebmJul 30, 2009 7:25 am 
Igor SysoevJul 30, 2009 12:00 pm 
holstebmJul 30, 2009 7:40 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: try_files problemActions...
From:Maxim Dounin (mdou@mdounin.ru)
Date:Jul 28, 2009 1:58:53 am
List:ru.sysoev.nginx

Hello!

On Tue, Jul 28, 2009 at 01:43:57AM -0400, holstebm wrote:

I can't get the following to work and, after reading and re-reading all the
documentation I could find, am not sure if this is a bug or a restriction.

try_files @nocache @cache;

The thought here is @nocache will succeed if a cookie is present and @cache will
succeed if not.

Try_files doesn't work this way. It checks *files* and uses fallback in no one was found:

try_files /file1 /file2 @fallback;

Looks like

http://wiki.nginx.org/NginxHttpCoreModule#try_files

has wrong description and should be re-translated from scratch. For a while use original documentation in Russian:

http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#try_files

(try google translate if you have problems with Russian).

The problem is, the first argument seems to be ignored. I say that because, if
I change JUST the try_files without changing any other lines in the
configuration I get two different results. In each case, the final argument in
the try_files is always reached...cache displaying correctly when there is no
cookie and a blank page if there is a cookie while try_files @cache @nocache
displays correctly when there is a cookie but a blank page if there is not.

So is this a restriction or a bug on using internal locations in try_files?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,4504,4504#msg-4504