0
votes

I need to health check backend servers with HEAD request by looking for /serverup.html file and expect 200 status

I tried using "option httpchk HEAD /serverup" and "http-check expect status 200"

frontend test1

mode http

bind 192.168.100.1:80

default_backend test1

backend test1

description Test Webpage

balance leastconn

mode http

option httpchk /serverup

http-check expect status 200

server webserver1 192.168.100.101:80 check inter 3s fall 3 rise 5 downinter 1m

server webserver2 192.168.100.102:80 check inter 3s fall 3 rise 5 downinter 1m

server webserver3 192.168.100.103:80 check inter 3s fall 3 rise 5 downinter 1m

server webserver4 192.168.100.104:80 check inter 3s fall 3 rise 5 downinter 1m

1

1 Answers

0
votes

some servers requires also the host header.

can you try the following line for the check

option httpchk HEAD /serverup\n\rHost: your-backend-http-hostname\n\r\n\r