reverseproxy: Err 503 if all upstreams unavailable
This commit is contained in:
parent
54d1923ccb
commit
d6bc9e0b5c
1 changed files with 1 additions and 1 deletions
|
|
@ -477,7 +477,7 @@ func (h *Handler) proxyLoopIteration(r *http.Request, origReq *http.Request, w h
|
||||||
upstream := h.LoadBalancing.SelectionPolicy.Select(upstreams, r, w)
|
upstream := h.LoadBalancing.SelectionPolicy.Select(upstreams, r, w)
|
||||||
if upstream == nil {
|
if upstream == nil {
|
||||||
if proxyErr == 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) {
|
if !h.LoadBalancing.tryAgain(h.ctx, start, proxyErr, r) {
|
||||||
return true, proxyErr
|
return true, proxyErr
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue