【发布时间】:2019-01-26 01:10:09
【问题描述】:
我已阅读并尝试了类似帖子中提到的几乎所有步骤/选项。 这是我的 Nginx 文件的样子:
location / {
proxy_pass http://localhost:8000;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
我正在尝试从基本身份验证中排除以下部分:
/engine/v1/状态
到目前为止,我已经尝试了以下方法:
location **/engine/v1/status** {
**auth_basic "off"**;
allow all; # Allow all to see content
}
location **= /engine/v1/status** {
**auth_basic off;**
allow all; # Allow all to see content
}
location **= /engine/v1/status** {
**auth_basic "off";**
allow all; # Allow all to see content
}
我还是得到了一个
HTTP 401: Unauthorized 您配置了一个侦听器规则来进行身份验证 用户。您将 OnUnauthenticatedRequest 配置为拒绝 未经身份验证的用户或 IdP 拒绝访问
在我的 AWS 目标组上 我在这里做错了什么?
【问题讨论】:
-
我认为
**s 只是噪音。off是关键字而不是字符串,因此不应被引用。如果该位置打算反向代理上游,它也需要一个proxy_pass语句。 -
@RichardSmith 谢谢你的建议。我能够达到预期的结果。
标签: amazon-web-services nginx amazon-elb nginx-location