summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-05-24 15:25:31 +0200
committerGitHub <noreply@github.com>2024-05-24 15:25:31 +0200
commit9cde20b45783bc874422a415c503fc79875115e5 (patch)
tree4a87e95554462e45b482b260309d7da67cb8d694 /data
parent371517c4dcf91d07a2145f0a1a1dc52762464ed6 (diff)
parent6c25888fe0e3773cb21b31ffac08c44af5d68a68 (diff)
downloadvyos-1x-9cde20b45783bc874422a415c503fc79875115e5.tar.gz
vyos-1x-9cde20b45783bc874422a415c503fc79875115e5.zip
Merge pull request #3512 from vyos/mergify/bp/sagitta/pr-3487
reverse-proxy: T6370: Set custom HTTP headers in reverse-proxy responses (backport #3487)
Diffstat (limited to 'data')
-rw-r--r--data/templates/load-balancing/haproxy.cfg.j210
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() %}