aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/reverseproxy/caddyfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/reverseproxy/caddyfile.go')
-rw-r--r--modules/caddyhttp/reverseproxy/caddyfile.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go
index 66bbcbcd4..93cc29568 100644
--- a/modules/caddyhttp/reverseproxy/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/caddyfile.go
@@ -69,6 +69,8 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error)
// health_uri <uri>
// health_port <port>
// health_interval <interval>
+// health_passes <num>
+// health_fails <num>
// health_timeout <duration>
// health_status <status>
// health_body <regexp>
@@ -447,6 +449,38 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
}
h.HealthChecks.Active.ExpectBody = d.Val()
+ case "health_passes":
+ if !d.NextArg() {
+ return d.ArgErr()
+ }
+ if h.HealthChecks == nil {
+ h.HealthChecks = new(HealthChecks)
+ }
+ if h.HealthChecks.Active == nil {
+ h.HealthChecks.Active = new(ActiveHealthChecks)
+ }
+ passes, err := strconv.Atoi(d.Val())
+ if err != nil {
+ return d.Errf("invalid passes count '%s': %v", d.Val(), err)
+ }
+ h.HealthChecks.Active.Passes = passes
+
+ case "health_fails":
+ if !d.NextArg() {
+ return d.ArgErr()
+ }
+ if h.HealthChecks == nil {
+ h.HealthChecks = new(HealthChecks)
+ }
+ if h.HealthChecks.Active == nil {
+ h.HealthChecks.Active = new(ActiveHealthChecks)
+ }
+ fails, err := strconv.Atoi(d.Val())
+ if err != nil {
+ return d.Errf("invalid fails count '%s': %v", d.Val(), err)
+ }
+ h.HealthChecks.Active.Fails = fails
+
case "max_fails":
if !d.NextArg() {
return d.ArgErr()