From 2ebee2a3b8c57ef22de8d5bb5dc232ad0830a385 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 20 Jun 2022 07:46:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=BA=90=E7=AB=99=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=93=E5=B1=9E=E5=9F=9F=E5=90=8D=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=BA=90=E7=AB=99=E4=B8=8D=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/reverse_proxy_config.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/serverconfigs/reverse_proxy_config.go b/pkg/serverconfigs/reverse_proxy_config.go index a65a657..ce064e0 100644 --- a/pkg/serverconfigs/reverse_proxy_config.go +++ b/pkg/serverconfigs/reverse_proxy_config.go @@ -92,6 +92,7 @@ func (this *ReverseProxyConfig) Init() error { } } } + for _, origin := range this.BackupOrigins { if len(origin.Domains) == 0 { group, ok := this.schedulingGroupMap[""] @@ -123,9 +124,10 @@ func (this *ReverseProxyConfig) Init() error { if hasDomainGroups { defaultGroup, ok := this.schedulingGroupMap[""] if ok { - delete(this.schedulingGroupMap, "") - - for _, group := range this.schedulingGroupMap { + for domain, group := range this.schedulingGroupMap { + if domain == "" { + continue + } for _, origin := range defaultGroup.PrimaryOrigins { group.PrimaryOrigins = append(group.PrimaryOrigins, origin) }