try_files issue

Igor Sysoev is at rambler-co.ru
Sat Feb 14 00:28:22 MSK 2009


On Fri, Feb 13, 2009 at 10:20:42PM +0100, Xavier Grangier wrote:

> I'm trying to use try_files like this (running 0.7.34)
> 
> location /users/ {
> 	root /home/website/people;
> 	set $uroot 1/15/334251/fr.html;
> 	try_files $document_root/$uroot @django;
> }
> 
> Despite the fact that /home/website/people/1/15/334251/fr.html exists  
> and is readable by nginx, I'm always redirected to @django
> This is an exemple, in real case the $uroot variable is build.
> 
> 
> Here is the debug log :
> 
> 2009/02/13 22:04:33 [debug] 14340#0: *1 try to use file: "/home/ 
> website/people/1/15/334251/fr.html"
> 2009/02/13 22:04:33 [debug] 14340#0: *1 try to use file: "@django"
> 2009/02/13 22:04:33 [debug] 14340#0: *1 test location: "@django"
> 2009/02/13 22:04:33 [debug] 14340#0: *1 using location: @django "/ 
> users/334251/fr/?"
> 
> Thanks in advance,

try_files tests files in relation to root, so:

- 	try_files $document_root/$uroot @django;
+ 	try_files /$uroot @django;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list