mirror of https://github.com/caddyserver/caddy.git
reverseproxy: Err 503 if all upstreams unavailable
This commit is contained in:
parent
54d1923ccb
commit
d6bc9e0b5c
|
@ -477,7 +477,7 @@ func (h *Handler) proxyLoopIteration(r *http.Request, origReq *http.Request, w h
|
|||
upstream := h.LoadBalancing.SelectionPolicy.Select(upstreams, r, w)
|
||||
if upstream == nil {
|
||||
if proxyErr == nil {
|
||||
proxyErr = fmt.Errorf("no upstreams available")
|
||||
proxyErr = caddyhttp.Error(http.StatusServiceUnavailable, fmt.Errorf("no upstreams available"))
|
||||
}
|
||||
if !h.LoadBalancing.tryAgain(h.ctx, start, proxyErr, r) {
|
||||
return true, proxyErr
|
||||
|
|
Loading…
Reference in New Issue