try_files problem

holstebm nginx-forum at
Tue Jul 28 09:43:57 MSD 2009

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.

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:,4504,4504#msg-4504

More information about the nginx mailing list