【发布时间】:2018-09-27 08:43:57
【问题描述】:
我正在尝试在我的 kibana 服务前面设置基本身份验证,该服务在 https 上运行。从我从文档和其他在线资源中了解到,我需要创建一个具有凭据的用户列表。这是我做过的。在前端部分,我创建了 2 个 ACL,其中一个检查使用 http_auth 来验证凭据(或者我被引导相信)。然后我说如果两个 ACL 要求都满足(即正确的地址和正确的凭据),则使用正确的服务器。
运行curl -u admin:terriblePassw0rd https://example.com 我得到一个 404。我非常感谢任何关于修复什么或进一步查看的指针或指南。
感谢您的宝贵时间。
userlist userAuth
user admin insecure-password terriblePassw0rd
frontend default-frontend-hpp
bind :80
http-request redirect location https://example.com code 302 if { hdr_dom(host) -i example.com }
frontend default-frontend-https
bind :443 ssl crt /path/to/cert/example.pem
reqadd X-Forwarded-Proto:\ https
acl auth_check http_auth(userAuth)
acl example hdr(host) -i example.com
use_backend example-backend if example auth_check
backend example-backend
server name IP:port check
【问题讨论】:
-
我最终找到的解决方案是将auth check移到后端。所以它现在看起来像:``backend example-backend acl auth_check http_auth(userAuth) http-request auth realm servername unless auth_check server name IP:port check`
标签: proxy kibana reverse-proxy haproxy