"index off;" directive?

Fabiano Furtado fabianofurtado at gmail.com
Sun Apr 26 00:40:35 UTC 2026


Hello!

Recently, I encountered a peculiar situation in my freenginx config
where I needed to use autoindex to list the contents of a directory,
but the directory contained an index.html file, causing the autoindex
to fail.

As a workaround, I used "index file_not_found.fnf;", and it worked
fine! However, I started thinking about the implementation of an "off"
parameter for the index directive.

In a situation where the index file does not exist, and using
"autoindex off;", the system returns a HTTP 403, writing "directory
index of ".../" is forbidden" in the error_log. In other words, this
is the default return value of freenginx when it can't find the index
file.

In this scenario, could the "index off;" feature be implemented in freenginx?

I believe there must be solid reasons why this feature isn’t present
yet, especially since it is an old and mandatory module in the system,
but I can't imagine why.

Thank you in advance.
Fabiano Furtado


More information about the nginx-devel mailing list