We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e51e6f commit 31cfebcCopy full SHA for 31cfebc
modules/caddyhttp/reverseproxy/hosts.go
@@ -84,6 +84,15 @@ func (u *Upstream) Healthy() bool {
84
if healthy && u.healthCheckPolicy != nil {
85
healthy = u.Host.Fails() < u.healthCheckPolicy.MaxFails
86
}
87
+ if healthy && u.healthCheckPolicy != nil &&
88
+ u.healthCheckPolicy.MinSuccessRatio > 0 {
89
+ successes := u.Host.Successes()
90
+ if successes >= u.healthCheckPolicy.MinSuccesses {
91
+ fails := u.Host.Fails()
92
+ healthRatio := float64(fails) / float64(successes)
93
+ healthy = healthRatio < (1 - float64(u.healthCheckPolicy.MinSuccessRatio))
94
+ }
95
96
if healthy && u.cb != nil {
97
healthy = u.cb.OK()
98
0 commit comments