Ignore errors when serving a directory

1. Caddy version (caddy version):

v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=

2. How I run Caddy:

From Termux (Android), I use:

cd /
caddy file-server -browse -listen

3. The problem I’m having:

Some directory listings (e.g., the root / one) are not generated successfully, and show as blank pages in the browser. Their subdirectories and files are fine.

Caddy does not produce any errors, but having tried GitHub - m3ng9i/ran: a simple static web server written in Go as well, where a similar thing happens, the issue seems to be that there are some directories such as /.cache that the user running caddy does not have the permission to read. The parents of these unreadable directories then will not have their listings generated.

Is there any way to just ignore such errors?

So if I’m understanding correctly, you want file_server to still render a page even if the directory contents can’t be listed due to permission errors?

Yes? I don’t want the directory listing for /noAccess, but I do want them for /, which has other readable subdirectories and files.

This topic was automatically closed after 30 days. New replies are no longer allowed.