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 }