Using autoindex and the php index file

Hi.

My config looks like this:

location / {

index index.php;
autoindex off;
}

location /autoindx_dir/ {
autoindex on;
}

location /autoindx_dir/not/ {
autoindex off;
}

also I have the php cgi options.
The problem is that nginx opens the index.php for my root directory if i
open only the domain. If I go to the “autoindx_dir” directory I see the
directory files like i want. But if I open “autoindex_dir/not” I see
also the hole directory although i have a index.php.

Whats wrong ?

Posted at Nginx Forum:

On 12.10.2011 22:22, bimbonius wrote:

autoindex off;

}

also I have the php cgi options.
The problem is that nginx opens the index.php for my root directory if i
open only the domain. If I go to the “autoindx_dir” directory I see the
directory files like i want. But if I open “autoindex_dir/not” I see
also the hole directory although i have a index.php.

Whats wrong ?

Propably because you set up ‘index index.php;’ in location / and not in
/autoindex_dir/not/. Move it outside location /, like just into http {}

Read http://wiki.nginx.org/HttpCoreModule#location

– Piotr.

Shame on me :frowning:
Thx very much

Posted at Nginx Forum: