MEDIUM: check: include server address and port in the send-state header
This fixes an issue that occurs when backend servers run on different
addresses or ports and you wish to healthcheck them via a consistent
port. For example, if you allocate backends dynamically as containers
that expose different ports and you use an inetd based healthchecking
component that runs on a dedicated port.
By adding the server address and port to the send-state header, the
healthcheck component can deduce which address and port to check by
reading the X-Haproxy-Server-State header out of the healthcheck and
parsing out the address and port.
diff --git a/doc/configuration.txt b/doc/configuration.txt
index 34a1e49..e0aa485 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -3109,6 +3109,14 @@
checks on the total number before transition, just as appears in the stats
interface. Next headers are in the form "<variable>=<value>", indicating in
no specific order some values available in the stats interface :
+ - a variable "address", containing the address of the backend server.
+ This corresponds to the <address> field in the server declaration. For
+ unix domain sockets, it will read "unix".
+
+ - a variable "port", containing the port of the backend server. This
+ corresponds to the <port> field in the server declaration. For unix
+ domain sockets, it will read "unix".
+
- a variable "name", containing the name of the backend followed by a slash
("/") then the name of the server. This can be used when a server is
checked in multiple backends.