Skip to content

Commit

Permalink
T6246: adds haproxy http-check configuration documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nvollmar committed Apr 17, 2024
1 parent a2666e8 commit d70f20f
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/configuration/loadbalancing/reverse-proxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,32 @@ Backend
Send a Proxy Protocol version 2 header (binary format)


HTTP health check
^^^^^^^^^^^^^^^^^
For web application providing information about their state HTTP health checks can be used
to determine their availability.

.. cfgcmd:: set load-balancing reverse-proxy backend <name> http-check

Enables HTTP health checks using OPTION HTTP requests against '/' and
expecting a successful response in the 200-399 range.

.. cfgcmd:: set load-balancing reverse-proxy backend <name> http-check method <method>

Sets the HTTP method to be used, can be either: option, get, post, put

.. cfgcmd:: set load-balancing reverse-proxy backend <name> http-check uri <path>

Sets the endpoint to be used for health checks

.. cfgcmd:: set load-balancing reverse-proxy backend master http-check expect <condition>

Sets the expected result for considering it healthy.
Some possible examples are:
* ``status 200`` Expecting a 200 response code
* ``status 200-399`` Expecting a non-failure response code
* ``string success`` Expecting the string `success` in the response body


Gloabal
-------
Expand Down Expand Up @@ -287,3 +313,29 @@ connection limit of 4000 and a minimum TLS version of 1.3.
set load-balancing reverse-proxy global-parameters max-connections '4000'
set load-balancing reverse-proxy global-parameters tls-version-min '1.3'
Balancing with HTTP health checks
---------------------------------

This configuration enables HTTP health checks on backend servers.

.. code-block:: none
set load-balancing reverse-proxy service my-tcp-api backend 'bk-01'
set load-balancing reverse-proxy service my-tcp-api mode 'tcp'
set load-balancing reverse-proxy service my-tcp-api port '8888'
set load-balancing reverse-proxy backend bk-01 balance 'round-robin'
set load-balancing reverse-proxy backend bk-01 mode 'tcp'
set load-balancing reverse-proxy backend bk-01 http-check method 'get'
set load-balancing reverse-proxy backend bk-01 http-check uri '/health'
set load-balancing reverse-proxy backend bk-01 http-check expect 'status 200'
set load-balancing reverse-proxy backend bk-01 server srv01 address '192.0.2.11'
set load-balancing reverse-proxy backend bk-01 server srv01 port '8881'
set load-balancing reverse-proxy backend bk-01 server srv01 check
set load-balancing reverse-proxy backend bk-01 server srv02 address '192.0.2.12'
set load-balancing reverse-proxy backend bk-01 server srv02 port '8882'
set load-balancing reverse-proxy backend bk-01 server srv02 check

0 comments on commit d70f20f

Please sign in to comment.