Can fastcgi_index be used with multiple filenames?

Igor Sysoev is at rambler-co.ru
Sat Mar 8 13:40:30 MSK 2008


On Sat, Mar 08, 2008 at 11:24:08AM +0100, Aleksandar Lazic wrote:

> Hi,
> 
> On Sam 08.03.2008 05:01, Ian M. Evans wrote:
> >Igor Sysoev wrote:
> >>If php root and static root are the same, then you can use following:
> >>    location / {
> >>        index   index.shtml   index.php;
> >>        # static
> >>    }
> >>    location \.(php|shtml)$ {
> >>        fastcgi_pass  ...
> >>        # fastcgi_index is not needed here at all
> >>    }
> >
> >I guess I should never do config changes at 4:42 AM! Luckily, I can
> >just "cp oldconfig nginx.conf" and -HUP and the site's back and
> >running while I tweak some more.
> >
> >Currently anything that's not a static file gets passed to an Apache
> >backend and run as a PHP file.
> >
> >So index.php, index.shtml and even extensionless files are PHP
> >files. For example, /galleries/123/1 is a php file called galleries
> >that works with the /123/1 path info.
> 
> Maybe this help you, what I have seen yesterday was:
> 
> index index.php;
> 
> and a request like 'GET / ...' have not called index.php, after I have
> changed to
> 
> index /index.php;
> 
> everything was fine.

No, "index /index.php" means that all /'s will be handled by
single root /index.php. The absolute index may be used as last resort:

      index  index.php  /index.php;


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





More information about the nginx mailing list