mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
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…
Reference in a new issue