(self, proxy_dir: str)
| 151 | return data |
| 152 | |
| 153 | def check_location(self, proxy_dir: str) -> Optional[str]: |
| 154 | # 伪静态文件路径 |
| 155 | rewrite_conf_path = "%s/vhost/rewrite/%s%s.conf" % (self.panel_path, self.config_prefix, self.site_name) |
| 156 | |
| 157 | rep_location = re.compile(r"\s*location\s+(\^~\s*)?%s\s*{" % re.escape(proxy_dir)) |
| 158 | |
| 159 | for i in [rewrite_conf_path, self._ng_file]: |
| 160 | conf = read_file(i) |
| 161 | if isinstance(conf, str) and rep_location.search(conf): |
| 162 | return '伪静态/站点主配置文件已经存路径【{}】的配置'.format(proxy_dir) |
| 163 | |
| 164 | @staticmethod |
| 165 | def _set_nginx_proxy_base(): |
no test coverage detected