【发布时间】:2018-03-12 00:49:50
【问题描述】:
我在尝试为 ELB 运行状况检查实施基本身份验证时遇到问题。 我已经搜索了很多以找出 nginx 文件配置以避免如下所示的 401 错误,ELB 由于基本身份验证而返回
unhealthy in target-group hogehoge due to (reason Health checks failed with these codes: [401])
我试图修改 nginx.conf 以避免它,但它不起作用。
下面的代码给了我[emerg] "server" directive is not allowed here 错误。
http {
server {
location / {
if (!$http_x_forwarded_for) {
auth_basic 'Please enter ID and password';
auth_basic_user_file /usr/src/redmine/.htpasswd;
}
}
}
}
如何避免 ELB 健康检查由于基本身份验证导致的 401 错误?
感谢您的帮助。
【问题讨论】:
-
您必须在自定义配置中添加它才能启用基本身份验证?您是如何首先启用身份验证的?
标签: amazon-web-services nginx passenger amazon-elb