diff options
author | yaxin <yaxin.me@gmail.com> | 2021-01-05 02:26:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 11:26:18 -0700 |
commit | 3c9256a1bea79a542500c8d07a9fd06fa806a79e (patch) | |
tree | c3710568f568388641eb1a7aac904edb205a4f2c /caddytest | |
parent | 7846bc1e06b2de97906cd562d16db4b2aafbd74b (diff) |
reverseproxy: Caddyfile health check headers, host header support (#3948)
* reverse_proxy: 1.health check headers can be set through Caddyfile using health_headers directive; 2.health check header host can be set properly
* reverse_proxy:
replace example with syntax definition
inline health_headers directive parse function
* bugfix: change caddyfile_adapt testcase file from space to tab
* reverseproxy: modify health_header value document as optional and add more test cases
Diffstat (limited to 'caddytest')
-rw-r--r-- | caddytest/integration/caddyfile_adapt/reverse_proxy_health_headers.txt | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/reverse_proxy_health_headers.txt b/caddytest/integration/caddyfile_adapt/reverse_proxy_health_headers.txt new file mode 100644 index 0000000..a3d842a --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/reverse_proxy_health_headers.txt @@ -0,0 +1,57 @@ +:8884 + +reverse_proxy 127.0.0.1:65535 { + health_headers { + Host example.com + X-Header-Key 95ca39e3cbe7 + X-Header-Keys VbG4NZwWnipo 335Q9/MhqcNU3s2TO + X-Empty-Value + } +} +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":8884" + ], + "routes": [ + { + "handle": [ + { + "handler": "reverse_proxy", + "health_checks": { + "active": { + "headers": { + "Host": [ + "example.com" + ], + "X-Empty-Value": [ + "" + ], + "X-Header-Key": [ + "95ca39e3cbe7" + ], + "X-Header-Keys": [ + "VbG4NZwWnipo", + "335Q9/MhqcNU3s2TO" + ] + } + } + }, + "upstreams": [ + { + "dial": "127.0.0.1:65535" + } + ] + } + ] + } + ] + } + } + } + } +} |