627 shaares
Pour passer un Host Header au niveau du healthcheck d'un backend HAproxy, il est possible de parametrer le header dans la version HTTP utilisé par le check.
C'est utile quand on souhaite mettre un apache avec plusieurs vhosts derrière le HAproxy.
<version> is the optional HTTP version string. It defaults to "HTTP/1.0"
but some servers might behave incorrectly in HTTP 1.0, so turning
it to HTTP/1.1 may sometimes help. Note that the Host field is
mandatory in HTTP/1.1, and as a trick, it is possible to pass it
after "\r\n" following the version string.
option httpchk OPTIONS * HTTP/1.1\r\nHost:\ www.example.com