fastcgi & index

Maxim Dounin mdounin at mdounin.ru
Thu Feb 13 14:20:42 UTC 2014


Hello!

On Thu, Feb 13, 2014 at 06:12:58AM -0800, Grant wrote:

> > The "fastcgi_index" directive is to instruct a fastcgi backend
> > which file to use if a request with an URI ending with "/" is
> > passed to the backend.  That is, it makes sense in a configuration
> > like this:
> >
> >     location / {
> >         fastcgi_pass  localhost:9000;
> >         fastcgi_index index.php;
> >         include       fastcgi.conf;
> >     }
> >
> > It doesn't make sense in configurations with only *.php file
> > passed to fastcgi backends though.  E.g., in a configuration like
> > this it doesn't make sense and should be removed:
> >
> >     location ~ \.php$ {
> >         fastcgi_pass  localhost:9000;
> >         # wrong: fastcgi_index doesn't make sense here
> >         fastcgi_index index.php;
> >         include       fastcgi.conf;
> >     }
> 
> In that case, should it be removed from the example here:
> 
> http://wiki.nginx.org/PHPFcgiExample

Yes, feel free to do so.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list