diff options
| author | Nobi <nobi@nobidev.com> | 2025-06-28 02:20:34 +0700 |
|---|---|---|
| committer | Nobi <nobi@nobidev.com> | 2025-07-13 01:17:17 +0700 |
| commit | dfaf242147cecc8a8737cd0ff67aa66f63cf8d02 (patch) | |
| tree | faf45931b26dc29f924c4ba121928c203cef920d /data/templates/load-balancing/haproxy.cfg.j2 | |
| parent | 0752a2713694229d2cb7bef08ea6afc4800a82b2 (diff) | |
| download | vyos-1x-dfaf242147cecc8a8737cd0ff67aa66f63cf8d02.tar.gz vyos-1x-dfaf242147cecc8a8737cd0ff67aa66f63cf8d02.zip | |
T7595: Support PROXY protocol for haproxy
Diffstat (limited to 'data/templates/load-balancing/haproxy.cfg.j2')
| -rw-r--r-- | data/templates/load-balancing/haproxy.cfg.j2 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/data/templates/load-balancing/haproxy.cfg.j2 b/data/templates/load-balancing/haproxy.cfg.j2 index 62934c612..b4c3505c9 100644 --- a/data/templates/load-balancing/haproxy.cfg.j2 +++ b/data/templates/load-balancing/haproxy.cfg.j2 @@ -62,8 +62,8 @@ backend buildin_acme_certbot frontend {{ front }}-http mode http {% if front_config.listen_address is vyos_defined %} -{% for address in front_config.listen_address %} - bind {{ address | bracketize_ipv6 }}:80 +{% for address, server_config in front_config.listen_address.items() %} + bind {{ address | bracketize_ipv6 }}:80 {{ 'accept-proxy' if server_config.accept_proxy is vyos_defined }} {% endfor %} {% else %} bind [::]:80 v4v6 @@ -82,8 +82,8 @@ frontend {{ front }} {% endif %} {% set ssl_directive = 'ssl' if ssl_front else '' %} {% if front_config.listen_address is vyos_defined %} -{% for address in front_config.listen_address %} - bind {{ address | bracketize_ipv6 }}:{{ front_config.port }} {{ ssl_directive }} {{ ssl_front | join(' ') }} +{% for address, server_config in front_config.listen_address.items() %} + bind {{ address | bracketize_ipv6 }}:{{ front_config.port }} {{ ssl_directive }} {{ ssl_front | join(' ') }} {{ 'accept-proxy' if server_config.accept_proxy is vyos_defined }} {% endfor %} {% else %} bind [::]:{{ front_config.port }} v4v6 {{ ssl_directive }} {{ ssl_front | join(' ') }} |
