我想使目录/srv/www/dssx (主要是)的内容公开。我想通过基本身份验证保护的子目录/srv/www/dssx/basic-auth of /srv/www/dssx。但是,我无法让它工作:我尝试过的所有配置都允许公共访问子目录,而不需要基本的auth。这是我的配置:
# Running under Apache 2.4.38
DocumentRoot /srv/www/dssx
# Allow unrestricted access to all XML and PEM files.
我在测试服务器上启用了Apache basic身份验证,它运行得很好:
AuthType Basic
AuthName "testing"
AuthUserFile /home/www/.htpasswd
Require user MyUser
deny from all
但它还试图验证通过OPTIONS方法发送的请求的身份。这是一个问题,因为CORS规范要求您应该使用Exclude user credentials - https://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0。
如何禁用使用OPTIO