From d9d1bde9f6bd08d4f48982e7df78eed53619ec72 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Mon, 29 Jul 2024 11:44:08 -0400 Subject: [PATCH 1/2] return 502 on proxy error (#703) --- endpoints/proxy/backend.go | 1 + 1 file changed, 1 insertion(+) diff --git a/endpoints/proxy/backend.go b/endpoints/proxy/backend.go index 9a22ce00..a181b025 100644 --- a/endpoints/proxy/backend.go +++ b/endpoints/proxy/backend.go @@ -95,6 +95,7 @@ func newReverseProxy(cfg *BackendConfig) (*httputil.ReverseProxy, error) { } proxy.ErrorHandler = func(w http.ResponseWriter, r *http.Request, err error) { logrus.Errorf("error proxying: %v", err) + w.WriteHeader(http.StatusBadGateway) } return proxy, nil From d29b6ca6d390cad0162e9b27b70ee9f0cab6693f Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Mon, 29 Jul 2024 11:45:18 -0400 Subject: [PATCH 2/2] changelog (#703) --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8280ce3..646854c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v0.4.37 + +FIX: When an error occurs connecting to the proxied endpoint, the `proxy` backend should return HTTP status `502` (https://github.com/openziti/zrok/issues/703) + ## v0.4.36 FEATURE: New interstitial pages that can be enabled per-frontend, and disabled per-account (https://github.com/openziti/zrok/issues/704)