From 0ebeeaebd6c3750f9cf667a851a95d0c80af96d3 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:04:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20WAF=20=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E5=AE=89=E8=A3=85=E5=88=9B=E5=BB=BA=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#4354)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/website.go | 5 +++-- backend/app/service/website_utils.go | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 484c5f89b..e6f85ab00 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -326,10 +326,11 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) } } - if err = createWafConfig(website, domains); err != nil { + if err = configDefaultNginx(website, domains, appInstall, runtime); err != nil { return err } - if err = configDefaultNginx(website, domains, appInstall, runtime); err != nil { + + if err = createWafConfig(website, domains); err != nil { return err } diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go index bad4e2428..9e0637883 100644 --- a/backend/app/service/website_utils.go +++ b/backend/app/service/website_utils.go @@ -365,6 +365,13 @@ func createWafConfig(website *model.Website, domains []model.WebsiteDomain) erro } } + if err = opNginx(nginxInstall.ContainerName, constant.NginxCheck); err != nil { + return err + } + if err = opNginx(nginxInstall.ContainerName, constant.NginxReload); err != nil { + return err + } + return nil }