aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJesper Brix Rosenkilde <[email protected]>2024-07-12 23:01:58 +0200
committerGitHub <[email protected]>2024-07-12 17:01:58 -0400
commit07c863637dff831c99d91cce129899ac8aa7b25c (patch)
treecb2a283bf37514879a2fd5c9fd3fc02dbe846312 /modules
parentdc2a5d5c52b3baeac182311fe7473870e671126a (diff)
downloadcaddy-07c863637dff831c99d91cce129899ac8aa7b25c.tar.gz
caddy-07c863637dff831c99d91cce129899ac8aa7b25c.zip
reverseproxy: Caddyfile support for health_method (#6454)
* Add Caddyfile support of setting active health check request method * Add integration test for active health check request method
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/reverseproxy/caddyfile.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go
index 9de7aedd9..ab180b3d8 100644
--- a/modules/caddyhttp/reverseproxy/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/caddyfile.go
@@ -79,6 +79,7 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error)
// health_headers {
// <field> [<values...>]
// }
+// health_method <value>
//
// # passive health checking
// fail_duration <duration>
@@ -387,6 +388,18 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
}
h.HealthChecks.Active.Headers = healthHeaders
+ case "health_method":
+ if !d.NextArg() {
+ return d.ArgErr()
+ }
+ if h.HealthChecks == nil {
+ h.HealthChecks = new(HealthChecks)
+ }
+ if h.HealthChecks.Active == nil {
+ h.HealthChecks.Active = new(ActiveHealthChecks)
+ }
+ h.HealthChecks.Active.Method = d.Val()
+
case "health_interval":
if !d.NextArg() {
return d.ArgErr()