From b6b4bfe19597b6e65e2a1c714253a1f842021c29 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 23 Apr 2024 18:04:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E4=BD=8E=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20OpenResty=20=E5=88=9B=E5=BB=BA=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=20(#4661)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/website_utils.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go index 1e36b22e6..907e27146 100644 --- a/backend/app/service/website_utils.go +++ b/backend/app/service/website_utils.go @@ -288,6 +288,10 @@ func createWafConfig(website *model.Website, domains []model.WebsiteDomain) erro if err != nil { return err } + + if !common.CompareVersion(nginxInstall.Version, "1.21.4.3-2-0") { + return nil + } wafDataPath := path.Join(nginxInstall.GetPath(), "1pwaf", "data") fileOp := files.NewFileOp() if !fileOp.Stat(wafDataPath) { @@ -419,6 +423,9 @@ func delWafConfig(website model.Website, force bool) error { if err != nil { return err } + if !common.CompareVersion(nginxInstall.Version, "1.21.4.3-2-0") { + return nil + } wafDataPath := path.Join(nginxInstall.GetPath(), "1pwaf", "data") fileOp := files.NewFileOp() if !fileOp.Stat(wafDataPath) {