在Haproxy的httpchk使用basic认证

在haproxy的httpchk使用basic认证,解决方法

base64编码username以及密码

1
echo -n "my_username:my_password" | base64

示例

1
2
# echo -n "reader:test" | base64
cmVhZGVyOnRlc3Q=

配置basci 认证

header配置

1
option  httpchk HEAD /db/manage/server/ha/slave HTTP/1.0\r\nAuthorization:\ Basic\ cmVhZGVyOnRlc3Q=

参考资料
https://serverfault.com/questions/801247/haproxy-httpchk-with-authentication
https://discourse.haproxy.org/t/haproxy-health-checks-with-authentication/94/4
https://www.haproxy.org/download/1.7/doc/configuration.txt

本文标题:在Haproxy的httpchk使用basic认证

文章作者:Francis

原始链接:http://www.cnops.com/posts/e37103fb.html

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。