From e88eda56f5ca949e3b5a49bdd819ca3943c0f19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 4 May 2022 10:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9B=BF=E6=8D=A2Location?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=9C=B0=E5=9D=80=E6=97=B6=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E6=98=AF=E5=90=A6=E4=B8=BA=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_reverse_proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/nodes/http_request_reverse_proxy.go b/internal/nodes/http_request_reverse_proxy.go index 37ea03d..d72c28d 100644 --- a/internal/nodes/http_request_reverse_proxy.go +++ b/internal/nodes/http_request_reverse_proxy.go @@ -283,7 +283,7 @@ func (this *HTTPRequest) doReverseProxy() { var locationHeader = resp.Header.Get("Location") if len(locationHeader) > 0 { locationURL, err := url.Parse(locationHeader) - if err == nil && (locationURL.Host == originAddr || strings.HasPrefix(originAddr, locationURL.Host+":")) { + if err == nil && locationURL.Host != this.ReqHost && (locationURL.Host == originAddr || strings.HasPrefix(originAddr, locationURL.Host+":")) { locationURL.Host = this.ReqHost if this.IsHTTP { locationURL.Scheme = "http"