Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 16:45 UTC
reverseproxy: Err 503 if all upstreams unavailable
Matthew Holt committed
Jul 8, 2022 at 13:01 UTC
d6bc9e0b5c748c999e30051bf04d622dbbb0a156
1 file changed
+1
-1
modules/caddyhttp/reverseproxy/reverseproxy.go
+1
-1
@@ -477,7 +477,7 @@ func (h *Handler) proxyLoopIteration(r *http.Request, origReq *http.Request, w h
477
upstream := h.LoadBalancing.SelectionPolicy.Select(upstreams, r, w)
478
if upstream == nil {
479
if proxyErr == nil {
480
- proxyErr = fmt.Errorf("no upstreams available")
480
+ proxyErr = caddyhttp.Error(http.StatusServiceUnavailable, fmt.Errorf("no upstreams available"))
481
}
482
if !h.LoadBalancing.tryAgain(h.ctx, start, proxyErr, r) {
483
return true, proxyErr