diff options
author | Francis Lavoie <lavofr@gmail.com> | 2021-03-29 20:36:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 18:36:40 -0600 |
commit | 75f797debdd6c4294497edba9889c6251a8542e7 (patch) | |
tree | 7146a299bbc84ace3df9d57ba9ac6febb984f818 /caddytest | |
parent | 1c8ea0082822fbc13cb6b86443b908f6a068f385 (diff) |
reverseproxy: Implement health_uri, deprecate health_path, supports query (#4050)
* reverseproxy: Implement health_uri, replaces health_path, supports query
Also fixes a bug with `health_status` Caddyfile parsing , it would always only take the first character of the status code even if it didn't end with "xx".
* reverseproxy: Rename to URI, named logger, warn in Provision (for JSON)
Diffstat (limited to 'caddytest')
-rw-r--r-- | caddytest/integration/caddyfile_adapt/reverse_proxy_health_path_query.txt | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/reverse_proxy_health_path_query.txt b/caddytest/integration/caddyfile_adapt/reverse_proxy_health_path_query.txt new file mode 100644 index 0000000..80ac2de --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/reverse_proxy_health_path_query.txt @@ -0,0 +1,75 @@ +# Health with query in the uri +:8443 { + reverse_proxy localhost:54321 { + health_uri /health?ready=1 + health_status 2xx + } +} + +# Health without query in the uri +:8444 { + reverse_proxy localhost:54321 { + health_uri /health + health_status 200 + } +} + +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":8443" + ], + "routes": [ + { + "handle": [ + { + "handler": "reverse_proxy", + "health_checks": { + "active": { + "expect_status": 2, + "uri": "/health?ready=1" + } + }, + "upstreams": [ + { + "dial": "localhost:54321" + } + ] + } + ] + } + ] + }, + "srv1": { + "listen": [ + ":8444" + ], + "routes": [ + { + "handle": [ + { + "handler": "reverse_proxy", + "health_checks": { + "active": { + "expect_status": 200, + "uri": "/health" + } + }, + "upstreams": [ + { + "dial": "localhost:54321" + } + ] + } + ] + } + ] + } + } + } + } +} |