diff --git a/README.md b/README.md index f1baed0..fd6e7fd 100644 --- a/README.md +++ b/README.md @@ -308,7 +308,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst * `haproxy_backend.{n}.source`: [optional]: Set the source address or interface for connections from the proxy * `haproxy_backend.{n}.option`: [optional]: Options to set (e.g. `[forwardfor]`) * `haproxy_backend.{n}.no_option`: [optional]: Options to unset (e.g. `[redispatch]`) -* `haproxy_backend.{n}.http_check`: [optional]: Make HTTP health checks consider response contents or specific status codes (e.g. `expect status 403`) +* `haproxy_backend.{n}.http_check.{n}`: [optional]: Configure HTTP health checks (e.g. `expect status 403`, `send meth GET uri /healthz`) * `haproxy_backend.{n}.stick`: [optional]: Stick declarations * `haproxy_backend.{n}.stick.{n}.table`: [required]: Configure the stickiness table for the current section (e.g. `type ip size 500k`) * `haproxy_backend.{n}.stick.{n}.stick_on`: [optional]: Define a request pattern to associate a user to a server (e.g. `src`) diff --git a/templates/etc/haproxy/backend.cfg.j2 b/templates/etc/haproxy/backend.cfg.j2 index e7419a6..cf1c9a8 100644 --- a/templates/etc/haproxy/backend.cfg.j2 +++ b/templates/etc/haproxy/backend.cfg.j2 @@ -20,7 +20,13 @@ backend {{ backend.name }} no option {{ option }} {% endfor %} {% if backend.http_check is defined %} +{% if backend.http_check is string %} http-check {{ backend.http_check }} +{% else %} +{% for http_check in backend.http_check %} + http-check {{ http_check }} +{% endfor %} +{% endif %} {% endif %} {% if backend.cookie is defined %} cookie {{ backend.cookie }}