diff options
author | Christian Breunig <christian@breunig.cc> | 2024-05-23 21:23:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 21:23:24 +0200 |
commit | 3e69d8bbe01b7d03c894e21ac322974799098676 (patch) | |
tree | 75ad19124b91c3e29142b40660a839c2fa17f8f9 /data/templates/load-balancing | |
parent | 5678e37fd0b37b266330cf2d1fde79071a96bf2b (diff) | |
parent | e1450096b4c667a4c33a3fcd8f67ebf6a39d441d (diff) | |
download | vyos-1x-3e69d8bbe01b7d03c894e21ac322974799098676.tar.gz vyos-1x-3e69d8bbe01b7d03c894e21ac322974799098676.zip |
Merge pull request #3487 from Embezzle/T6370
reverse-proxy: T6370: Set custom HTTP headers in reverse-proxy responses
Diffstat (limited to 'data/templates/load-balancing')
-rw-r--r-- | data/templates/load-balancing/haproxy.cfg.j2 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/data/templates/load-balancing/haproxy.cfg.j2 b/data/templates/load-balancing/haproxy.cfg.j2 index 7917c8257..797bf17e7 100644 --- a/data/templates/load-balancing/haproxy.cfg.j2 +++ b/data/templates/load-balancing/haproxy.cfg.j2 @@ -81,6 +81,11 @@ frontend {{ front }} {% endif %} {% endfor %} {% endif %} +{% if front_config.http_response_headers is vyos_defined %} +{% for header, header_config in front_config.http_response_headers.items() %} + http-response set-header {{ header }} '{{ header_config['value'] }}' +{% endfor %} +{% endif %} {% endif %} {% if front_config.rule is vyos_defined %} {% for rule, rule_config in front_config.rule.items() %} @@ -158,6 +163,11 @@ backend {{ back }} {% endif %} {% if back_config.mode is vyos_defined %} mode {{ back_config.mode }} +{% if back_config.http_response_headers is vyos_defined %} +{% for header, header_config in back_config.http_response_headers.items() %} + http-response set-header {{ header }} '{{ header_config['value'] }}' +{% endfor %} +{% endif %} {% endif %} {% if back_config.rule is vyos_defined %} {% for rule, rule_config in back_config.rule.items() %} |