haproxy httpchk with authentication

Is it possible to do health check httpchk and pass credentials?

I supposed to try to pass user name and password and if that fails to change server state to down.

Thanks


Solution 1:

I will answer to myself it might be helpful to someone else. This is what I've done.

$ echo -n "my_username:my_password" | base64 I got this string: TkxCX0hCOkhCREhCX0NoZWNr

After that I put the following int my conf:

option httpchk GET /CSHRIS/WS/Service.asmx HTTP/1.0\r\nAuthorization:\ Basic\ TkxCX0hCOkhCREhCX0NoZWNr