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:
http://forum.nginx.org/read.php?2,216607,216607#msg-216607

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:
http://forum.nginx.org/read.php?2,216607,216611#msg-216611

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs