From fa7d4963cb85566a2451ca6a3f886c49f4e45615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sun, 20 Aug 2023 15:50:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8D=E5=90=91=E4=BB=A3=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=98=AF=E5=90=A6=E9=87=8D=E8=AF=9550X=E9=80=89?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=BA=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_reverse_proxy.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/nodes/http_request_reverse_proxy.go b/internal/nodes/http_request_reverse_proxy.go index a761829..a8c6a67 100644 --- a/internal/nodes/http_request_reverse_proxy.go +++ b/internal/nodes/http_request_reverse_proxy.go @@ -374,6 +374,21 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId return } + // 50x + if resp != nil && + resp.StatusCode >= 500 && + resp.StatusCode < 510 && + this.reverseProxy.Retry50X && + (originId > 0 || (lnNodeId > 0 && hasMultipleLnNodes)) && + !isLastRetry { + if resp.Body != nil { + _ = resp.Body.Close() + } + + shouldRetry = true + return + } + // 记录相关数据 this.originStatus = int32(resp.StatusCode)