-f $request_filename

Igor Sysoev igor at sysoev.ru
Tue Apr 20 09:23:30 MSD 2010


On Mon, Apr 19, 2010 at 07:57:54PM +0200, Tomasz Pajor wrote:

> 
> > A generic method:
> >
> > location / {
> >      root /vhosts/default/test;
> >      try_files $uri $uri/ @fallback;
> > }
> >
> > location @fallback {
> >      fastcgi_pass unix:/var/run/spawn-fcgi.sock;
> >      ...
> > }
> >    
> This seems to work, just one question.
> The fastcgi application is Zend based, but i get an
> 
> 403 forbiddened when try_files is:
> $uri $uri/ @fallback
> 
> when i set it up to:
> $uri @fallback
> 
> it seems to work, why is that?

When you request "/", "try_files $uri/" founds that there is
a directory "/vhosts/default/test/" and nginx uses "location /"
for handling the request. Then the directive "index" tries to
find its default value "index.html". If it can not find it, this leads
to 403.

Probably, you need

location / {
    root /vhosts/default/test;
    try_files $uri $uri/ @fallback;
    index  index.php;
}


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



More information about the nginx mailing list