From 1735baf657cf662a4411183ff7c413628e54f44f Mon Sep 17 00:00:00 2001 From: CityFun <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 19 May 2025 15:41:47 +0800 Subject: [PATCH] fix: fix issue with re-enable the website failed (#8731) --- agent/app/service/website_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/app/service/website_utils.go b/agent/app/service/website_utils.go index 10cc7d34d..42425c17d 100644 --- a/agent/app/service/website_utils.go +++ b/agent/app/service/website_utils.go @@ -886,14 +886,14 @@ func opWebsite(website *model.Website, operate string) error { website.Status = constant.WebStopped } if operate == constant.StartWeb { - absoluteIncludeDir := path.Join(nginxInstall.Install.GetPath(), fmt.Sprintf("/www/sites/%s/proxy", website.Alias)) + absoluteIncludeDir := GetSitePath(*website, SiteProxyDir) fileOp := files.NewFileOp() if fileOp.Stat(absoluteIncludeDir) && !files.IsEmptyDir(absoluteIncludeDir) { proxyInclude := fmt.Sprintf("/www/sites/%s/proxy/*.conf", website.Alias) server.UpdateDirective("include", []string{proxyInclude}) } rewriteInclude := fmt.Sprintf("/www/sites/%s/rewrite/%s.conf", website.Alias, website.Alias) - absoluteRewritePath := path.Join(nginxInstall.Install.GetPath(), rewriteInclude) + absoluteRewritePath := GetSitePath(*website, SiteReWritePath) if fileOp.Stat(absoluteRewritePath) { server.UpdateDirective("include", []string{rewriteInclude}) } @@ -924,7 +924,7 @@ func opWebsite(website *model.Website, operate string) error { } if runtime.Type == constant.RuntimePHP { if website.ProxyType == constant.RuntimeProxyUnix || website.ProxyType == constant.RuntimeProxyTcp { - localPath = path.Join(nginxInstall.Install.GetPath(), rootIndex, "index.php") + localPath = path.Join(GetSitePath(*website, SiteIndexDir), "index.php") } server.UpdatePHPProxy([]string{website.Proxy}, localPath) } else {