Merge pull request #711 from openziti/proxy_502

Return 502 When Proxied Resource Gone (#703)
This commit is contained in:
Michael Quigley 2024-07-29 11:58:05 -04:00 committed by GitHub
commit 3283ad0cc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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