respond with 503 on empty backend

This commit is contained in:
Marco Jantke 2017-07-10 12:11:44 +02:00 committed by Ludovic Fernandez
parent 16609cd485
commit 074b31b5e9
5 changed files with 275 additions and 3 deletions

View file

@ -744,6 +744,7 @@ func (server *Server) loadConfig(configurations configs, globalConfiguration Glo
log.Debugf("Setting up backend health check %s", *hcOpts)
backendsHealthcheck[frontend.Backend] = healthcheck.NewBackendHealthCheck(*hcOpts)
}
lb = middlewares.NewEmptyBackendHandler(rebalancer, lb)
case types.Wrr:
log.Debugf("Creating load-balancer wrr")
if stickysession {
@ -764,6 +765,7 @@ func (server *Server) loadConfig(configurations configs, globalConfiguration Glo
log.Debugf("Setting up backend health check %s", *hcOpts)
backendsHealthcheck[frontend.Backend] = healthcheck.NewBackendHealthCheck(*hcOpts)
}
lb = middlewares.NewEmptyBackendHandler(rr, lb)
}
if len(frontend.Errors) > 0 {