"index off;" directive?

Fabiano Furtado fabianofurtado at gmail.com
Tue Apr 28 23:32:32 UTC 2026


Hi!

On Mon, Apr 27, 2026 at 9:04 PM Maxim Dounin wrote:
>
> Hello!
>
> On Mon, Apr 27, 2026 at 09:22:59 AM -0300, Fabiano Furtado wrote:
>
> > On Sun, Apr 26, 2026 at 7:53 PM Maxim Dounin wrote:
> > > ...
> > Anyway, I'm not sure if it's possible, but I'd like to try developing
> > this patch. Would it be okay if I tried to create this new patch?
>
> Yep, feel free to.
>
> Just in case, some hints can be found here:
> https://freenginx.org/en/docs/contributing_changes.html

This patch introduces the "index off;" directive for freenginx, but I
also had to modify other parts of the code to ensure this new
directive behaves correctly.
When "off" is applied in the config and an HTTP access occurs, a
message appears in the error_log: "directory index of ".../" is
forbidden". In this context, I believe this message is not
particularly relevant for the error_log. So, I added a flag to the
core called "log_forbidden", which works similarly to "log_not_found".

As a result, instead of modifying only "ngx_http_index_module.c", I
ended up changing four files:
  * src/http/ngx_http_core_module.c
  * src/http/ngx_http_core_module.h
  * src/http/modules/ngx_http_access_module.c
  * src/http/modules/ngx_http_index_module.c

I would appreciate it if the code could be reviewed. Any feedback or
suggestions are welcome.

Thank you in advance for the opportunity to submit this patch.
Fabiano Furtado
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ngx_http_core_module.c.patch
Type: text/x-patch
Size: 3416 bytes
Desc: not available
URL: <http://freenginx.org/pipermail/nginx-devel/attachments/20260428/bfbaa805/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ngx_http_index_module.c.patch
Type: text/x-patch
Size: 2803 bytes
Desc: not available
URL: <http://freenginx.org/pipermail/nginx-devel/attachments/20260428/bfbaa805/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ngx_http_core_module.h.patch
Type: text/x-patch
Size: 812 bytes
Desc: not available
URL: <http://freenginx.org/pipermail/nginx-devel/attachments/20260428/bfbaa805/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ngx_http_access_module.c.patch
Type: text/x-patch
Size: 751 bytes
Desc: not available
URL: <http://freenginx.org/pipermail/nginx-devel/attachments/20260428/bfbaa805/attachment-0003.bin>


More information about the nginx-devel mailing list