Created
August 20, 2021 14:30
-
-
Save haproxytechblog/cdf75a1636eab81d11bf9e6d49c40fd3 to your computer and use it in GitHub Desktop.
How to Enable Health Checks in HAProxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
server server1 192.168.50.2:80 check | |
server server2 192.168.50.3:80 check | |
server server3 192.168.50.4:80 check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server server1 192.168.50.2:80 check inter 10s fall 5 rise 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
option httpchk | |
server server1 192.168.50.2:80 check | |
server server2 192.168.50.3:80 check | |
server server3 192.168.50.4:80 check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
option httpchk | |
http-check send meth GET uri /health | |
server server1 192.168.50.2:80 check | |
server server2 192.168.50.3:80 check | |
server server3 192.168.50.4:80 check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
option httpchk | |
http-check send meth POST uri /health hdr Content-Type application/json body "{ \"foo\": \"bar\" }" | |
server server1 192.168.50.2:80 check | |
server server2 192.168.50.3:80 check | |
server server3 192.168.50.4:80 check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
option httpchk | |
http-check connect | |
http-check send meth GET uri /health | |
http-check expect status 200 | |
http-check connect | |
http-check send meth GET uri /health2 | |
http-check expect status 200 | |
server server1 192.168.50.2:80 check | |
server server2 192.168.50.3:80 check | |
server server3 192.168.50.4:80 check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http-check connect ssl alpn h2,http/1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
option httpchk | |
http-check send meth GET uri /health | |
http-check expect status 200 | |
server server1 192.168.50.2:80 check | |
server server2 192.168.50.3:80 check | |
server server3 192.168.50.4:80 check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http-check expect string success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
option httpchk | |
http-check send meth GET uri /health | |
server server1 192.168.50.2:80 check observe layer7 error-limit 50 on-error mark-down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend webservers | |
balance roundrobin | |
server server1 192.168.50.2:80 check weight 100 agent-check agent-inter 5s agent-addr 192.168.50.2 agent-port 3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment