HAproxy should use httpchk
against a page that requires authentication via basic auth.
backend backendname
option httpchk
http-check send meth GET uri /check/path/ ver HTTP/1.1 hdr Authorization 'Basic [base64 of the credentials]'
http-check expect status 200
server [server1-name] [server1-IP:PORT] check inter 10s rise 2 fall 1 maxconn 4
server [server2-name] [server2-IP:PORT] check inter 10s rise 2 fall 1 maxconn 4
HAproxy does not get the right response and the servers are unavailable.
The HAproxy configuration (server name, IPs, ports, etc..) apart from the http-check part is most likely not the problem, as HAproxy worked with that settings before.
Testing with curl http://localhost:PORT --header "Authorization: Basic [base64 of the credentials]"
on the server1 and server2 gets a 200 response.
Running the same HAproxy configuration against a script logging the headers of all received requests shows the exact same headers for the above curl call or HAproxy.