diff --git a/web/utils/site.py b/web/utils/site.py index 667b9ce371..20eba70e86 100644 --- a/web/utils/site.py +++ b/web/utils/site.py @@ -978,15 +978,15 @@ def setSiteRunPath(self, site_id, run_path): new_path = site_path + run_path # 处理Nginx - filename = self.getHostConf(site_name) - if os.path.exists(filename): - conf = mw.readFile(filename) + site_host = self.getHostConf(site_name) + if os.path.exists(site_host): + conf = mw.readFile(site_host) rep = r'\s*root\s*(.+);' path = re.search(rep, conf).groups()[0] conf = conf.replace(path, new_path) - mw.writeFile(filename, conf) + mw.writeFile(site_host, conf) - self.setSitePath(site_path, run_path) + self.setSitePath(site_id, run_path) mw.restartWeb() return mw.returnData(True, '设置成功!')