summaryrefslogtreecommitdiff
path: root/data/templates/load-balancing
diff options
context:
space:
mode:
authorNicolas Vollmar <nvo@scaling.ch>2024-04-17 11:14:11 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-04-19 11:48:35 +0000
commit5a8310147b858ab85ed5a00fa6cb1f2e856f6a0c (patch)
treedf34e2aa350271c4d7573d11b8cfffb41c49b6d4 /data/templates/load-balancing
parent63eb47d62eff7a294e06b438a26f2c2997c53f5b (diff)
downloadvyos-1x-5a8310147b858ab85ed5a00fa6cb1f2e856f6a0c.tar.gz
vyos-1x-5a8310147b858ab85ed5a00fa6cb1f2e856f6a0c.zip
T6246: adds basic haproxy http-check configuration
(cherry picked from commit 785616393557c4e3f616287de81b61a68ba177ac)
Diffstat (limited to 'data/templates/load-balancing')
-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] }}