"index off;" directive?

Fabiano Furtado fabianofurtado at gmail.com
Mon May 11 16:54:16 UTC 2026


Hi!

On Sat, May 9, 2026 at 8:15 PM Maxim Dounin wrote:
>
> Hello!
> [...]
> Looking more into this, I think about only checking "off" if there
> is only one argument.  Resulting syntax would be:
>
>     index off | file ...;
>
> With this approach,
>
>     index off;
>
> will switch off index usage, and will reject any attempts to define
> additional indexes, so
>
>     index off;
>     index index.html;
>
> and
>
>     index index.html;
>     index off;
>
> will be rejected.  At the same time, when "index off;" is clearly
> not the intention due to multiple arguments of the directive, such
> as in
>
>     index index.html off on;
>
> or
>
>     index off index.html;
>
> all arguments would be considered index file names, exactly as it
> works now.
>
> I tend to think this would be clearer from the syntax point of
> view.
>
> (The patch is essentially the same, but without checking for "off"
> in the loop.)
>
> What do you think?

Removing the "off" check from the loop makes the index configuration
more flexible because it allows using "off" as an index file, although
this is an extremely rare use case, which I think is OK. ;)

Fabiano Furtado


More information about the nginx-devel mailing list