summaryrefslogtreecommitdiff
path: root/src/conf_mode/load-balancing_reverse-proxy.py
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 /src/conf_mode/load-balancing_reverse-proxy.py
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 'src/conf_mode/load-balancing_reverse-proxy.py')
-rwxr-xr-xsrc/conf_mode/load-balancing_reverse-proxy.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/load-balancing_reverse-proxy.py b/src/conf_mode/load-balancing_reverse-proxy.py
index 1569d8d71..a4efb1cd8 100755
--- a/src/conf_mode/load-balancing_reverse-proxy.py
+++ b/src/conf_mode/load-balancing_reverse-proxy.py
@@ -88,6 +88,12 @@ def verify(lb):
if {'send_proxy', 'send_proxy_v2'} <= set(bk_server_conf):
raise ConfigError(f'Cannot use both "send-proxy" and "send-proxy-v2" for server "{bk_server}"')
+ # Check if http-response-headers are configured in any frontend/backend where mode != http
+ for group in ['service', 'backend']:
+ for config_name, config in lb[group].items():
+ if 'http_response_headers' in config and ('mode' not in config or config['mode'] != 'http'):
+ raise ConfigError(f'{group} {config_name} must be set to http mode to use http_response_headers!')
+
if 'ssl' in back_config:
if {'no_verify', 'ca_certificate'} <= set(back_config['ssl']):
raise ConfigError(f'backend {back} cannot have both ssl options no-verify and ca-certificate set!')