fastcgi & index

Grant emailgrant at gmail.com
Thu Feb 13 14:12:58 UTC 2014


> 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

- Grant



More information about the nginx mailing list