I am testing with a vanilla install of Rocky Linux 8.4 and Apache 2.4. I have a virtual host configured and working and I also configured Lets Encrypt cert via Certbot, this also works great.
I want to allow directory listings on a specific folder so have enabled Options Indexes, this works as expected via HTTP but via HTTPS I get 403 Forbidden. The Certbot script inserted the rewrite rule but I don't think that is the issue, I tried disabling that so I could test via HTTP and makes no difference but including it here in case it is infact relevant.
My virtual host conf looks like this:
<VirtualHost *:80>
ServerName test.prot0type.com
ServerAlias test.prot0type.com
DocumentRoot /var/www/test.prot0type.com
<Directory /var/www/test.prot0type.com/test>
Options +Indexes
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =test.prot0type.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName test.prot0type.com
ServerAlias test.prot0type.com
DocumentRoot /var/www/test.prot0type.com
<Directory /var/www/test.prot0type.com/test>
Options +Indexes
</Directory>
</VirtualHost>
Accessing http://test.prot0type.com/test/ works as expected.
Accessing https://test.prot0type.com/test/ results in 403 and in the error log I get:
Cannot serve directory /var/www/test.prot0type.com/test/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
How do I find which Options directive is doing this? I have searched all the conf files but can't find it.