summaryrefslogtreecommitdiff
path: root/data/templates/load-balancing/haproxy.cfg.j2
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-19 13:47:07 +0200
committerGitHub <noreply@github.com>2024-04-19 13:47:07 +0200
commit89b56ef6da19ccff2df508e4e4a04d4feff0e04e (patch)
tree66c07495d04bbc62ae18acc9de880ece6f6616ab /data/templates/load-balancing/haproxy.cfg.j2
parent8bb55a50d08b114562bac4e4d46dc3310055c771 (diff)
parent785616393557c4e3f616287de81b61a68ba177ac (diff)
downloadvyos-1x-89b56ef6da19ccff2df508e4e4a04d4feff0e04e.tar.gz
vyos-1x-89b56ef6da19ccff2df508e4e4a04d4feff0e04e.zip
Merge pull request #3325 from nvollmar/haproxy-http-check
T6246: basic haproxy http-check configuration
Diffstat (limited to 'data/templates/load-balancing/haproxy.cfg.j2')
-rw-r--r--data/templates/load-balancing/haproxy.cfg.j29
1 files changed, 9 insertions, 0 deletions
diff --git a/data/templates/load-balancing/haproxy.cfg.j2 b/data/templates/load-balancing/haproxy.cfg.j2
index feb10d247..83008e50a 100644
--- a/data/templates/load-balancing/haproxy.cfg.j2
+++ b/data/templates/load-balancing/haproxy.cfg.j2
@@ -110,6 +110,15 @@ frontend {{ front }}
{% if backend is vyos_defined %}
{% for back, back_config in backend.items() %}
backend {{ back }}
+{% if back_config.http_check is vyos_defined %}
+ option httpchk
+{% endif %}
+{% if back_config.http_check.uri is vyos_defined and back_config.http_check.method is vyos_defined %}
+ http-check send meth {{ back_config.http_check.method | upper }} uri {{ back_config.http_check.uri }}
+{% endif %}
+{% if back_config.http_check.expect is vyos_defined %}
+ http-check expect {{ back_config.http_check.expect }}
+{% endif %}
{% if back_config.balance is vyos_defined %}
{% set balance_translate = {'least-connection': 'leastconn', 'round-robin': 'roundrobin', 'source-address': 'source'} %}
balance {{ balance_translate[back_config.balance] }}