From 6c74ad4a01dc3766997b633c96aafdb27a422b1f Mon Sep 17 00:00:00 2001 From: 0xJacky Date: Thu, 5 Jan 2023 23:30:14 +0800 Subject: [PATCH] fix: upstream parse issue --- server/pkg/nginx/parse.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/pkg/nginx/parse.go b/server/pkg/nginx/parse.go index 39d2e454..158517d0 100644 --- a/server/pkg/nginx/parse.go +++ b/server/pkg/nginx/parse.go @@ -134,7 +134,9 @@ func parse(block gonginx.IBlock, ngxConfig *NgxConfig) { server.parseServer(v) ngxConfig.Servers = append(ngxConfig.Servers, server) case Upstream: - upstream := &NgxUpstream{} + upstream := &NgxUpstream{ + Name: strings.Join(v.GetParameters(), " "), + } upstream.Comments = comments upstream.parseUpstream(v) ngxConfig.Upstreams = append(ngxConfig.Upstreams, upstream)