gpt4 book ai didi

nginx:auth_basic 用于除特定位置以外的所有内容

转载 作者:行者123 更新时间:2023-12-03 11:49:07 25 4
gpt4 key购买 nike

如何为除某个文件之外的所有内容启用 HTTP 基本身份验证?

这是我当前该位置的服务器块配置:

location / {
auth_basic "The password, you must enter.";
auth_basic_user_file /etc/nginx/htpasswd;
}

location /README {
auth_basic off;
}

但是,在 /README ,它仍然提示输入密码。

我们怎样才能解决这个问题?

谢谢!
标记

最佳答案

尝试使用 sign = ,它可以帮助您:

location = /README {
auth_basic off;
allow all; # Allow all to see content
}

关于nginx:auth_basic 用于除特定位置以外的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9281564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com