diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-10-27 18:10:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-27 18:10:02 +0100 |
| commit | c4ead67fd111aa44314e604df1c4ec475fcedd45 (patch) | |
| tree | 2c0c074d7493202bf4edc5289a574fb528bae1c5 /data/templates | |
| parent | d316d808669994c4528b67a651fe0559a4b3dc77 (diff) | |
| parent | bba498d2cf6d897789641ca093c2d3b9daff8472 (diff) | |
| download | vyos-1x-c4ead67fd111aa44314e604df1c4ec475fcedd45.tar.gz vyos-1x-c4ead67fd111aa44314e604df1c4ec475fcedd45.zip | |
Merge pull request #4806 from alexandr-san4ez/T7906-current
haproxy: T7906: Probing of a port other than the one to which normal traffic is sent
Diffstat (limited to 'data/templates')
| -rw-r--r-- | data/templates/load-balancing/haproxy.cfg.j2 | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/data/templates/load-balancing/haproxy.cfg.j2 b/data/templates/load-balancing/haproxy.cfg.j2 index c73f71722..79fb5e369 100644 --- a/data/templates/load-balancing/haproxy.cfg.j2 +++ b/data/templates/load-balancing/haproxy.cfg.j2 @@ -250,7 +250,30 @@ backend {{ back }} {% if back_config.server is vyos_defined %} {% set ssl_back = 'ssl ca-file /run/haproxy/' ~ back_config.ssl.ca_certificate ~ '.pem' if back_config.ssl.ca_certificate is vyos_defined else ('ssl verify none' if back_config.ssl.no_verify is vyos_defined else '') %} {% for server, server_config in back_config.server.items() %} - server {{ server }} {{ server_config.address }}:{{ server_config.port }}{{ ' check' if server_config.check is vyos_defined }}{{ ' backup' if server_config.backup is vyos_defined }}{{ ' send-proxy' if server_config.send_proxy is vyos_defined }}{{ ' send-proxy-v2' if server_config.send_proxy_v2 is vyos_defined }} {{ ssl_back }} +{% set address = server_config.address %} +{% set port = server_config.port %} +{# Build optional flags #} +{% set flags = [] %} +{% if server_config.check is vyos_defined %} +{% set _ = flags.append('check') %} +{# Build nested 'check port' flag like this: '... check port 8080' #} +{% if server_config.check.port is vyos_defined %} +{% set _ = flags.extend(['port', server_config.check.port]) %} +{% endif %} +{% endif %} +{% if server_config.backup is vyos_defined %} +{% set _ = flags.append('backup') %} +{% endif %} +{% if server_config.send_proxy is vyos_defined %} +{% set _ = flags.append('send-proxy') %} +{% endif %} +{% if server_config.send_proxy_v2 is vyos_defined %} +{% set _ = flags.append('send-proxy-v2') %} +{% endif %} +{% if ssl_back %} +{% set _ = flags.append(ssl_back) %} +{% endif %} + server {{ server }} {{ address }}:{{ port }} {{ flags | select | join(' ') }} {% endfor %} {% endif %} {% if back_config.timeout.check is vyos_defined %} |
