Igor Sysoev is at
Sat Aug 16 23:38:43 MSD 2008

On Sat, Aug 16, 2008 at 12:32:30PM -0700, mike wrote:

> On 8/16/08, Igor Sysoev <is at> wrote:
> > If no one index file is found than directory test must be done anyway:
> > *) if directory exists, but no index files exist, then nginx should
> >   pass control to next module (autoindex) and may eventually return 403.
> > *) if directory does not exist, then nginx should return 404.
> but doesn't it make sense to go through all index file options before
> checking the directory and handing it off to autoindex? maybe i just
> don't know filesystem architecture good enough, but it seems like if
> the user states "check A, B, C" it should check A, B, C and only if it
> fails all 3 then fall back to sanity checks / directory checks /
> autoindex checks / etc.

There 3 reasons:

1) you assume that user will ask only existent directories.

2) directory test should be cheap syscall, because kernel has already read,
   tested, and cached file path after first open().

3) the last index may be default absolute file, like /index.html.

Igor Sysoev

More information about the nginx mailing list