在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