From 3b9eae70c9cc680792cdc86513f74f7cc49f43b1 Mon Sep 17 00:00:00 2001 From: Aleksei <37804671+aleert@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:02:31 +0300 Subject: [PATCH] reverseproxy: Change 500 error to 502 for lookup_srv config (#3771) Fixes #3763 --- modules/caddyhttp/reverseproxy/reverseproxy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/caddyhttp/reverseproxy/reverseproxy.go b/modules/caddyhttp/reverseproxy/reverseproxy.go index 138a3fc8..0f93df0e 100644 --- a/modules/caddyhttp/reverseproxy/reverseproxy.go +++ b/modules/caddyhttp/reverseproxy/reverseproxy.go @@ -384,7 +384,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht // DialInfo struct should have valid network address syntax dialInfo, err := upstream.fillDialInfo(r) if err != nil { - return fmt.Errorf("making dial info: %v", err) + err = fmt.Errorf("making dial info: %v", err) + return caddyhttp.Error(http.StatusBadGateway, err) } // attach to the request information about how to dial the upstream;