Commit 07c74324 by jiaotianqi

路由配置预览

parent 0f277eec
......@@ -104,7 +104,7 @@ public class GrayManagerController {
public RestResponse refreshRedisGrayConfig(HttpServletRequest request) {
GrayConfigUtil.refreshGrayConfig(null, true, false);
GrayConfigUtil.refreshGrayConfigChangeTimeByZk();
String res = HttpClientUtil.get(request.getScheme() + "://" + request.getServerName() +":"+ request.getServerPort() + "/gray-config-refresh");
String res = HttpClientUtil.get("https://" + request.getServerName() +"/gray-config-refresh");
return RestResponse.success(res);
}
......
......@@ -143,15 +143,9 @@ public class RouteManagerController {
nginxLocationConfigStr.append(" ").append(locationConfig).append(";\r\n");
}
}else {
nginxLocationConfigStr.append(" set_by_lua_file $target_upstream $grayRoute ").append(nginxLocationConfig.getId()).append(" ").append(nginxLocationConfig.getId()).append(" ").append(nginxLocationConfig.getId()).append("-gray;\r\n");
nginxLocationConfigStr.append(" alias /mydata/gicweb/$target_upstream/;\r\n");
nginxLocationConfigStr.append(" try_files $uri $uri/ /");
if(StringUtil.isNotBlank(nginxLocationConfig.getModule_path())){
nginxLocationConfigStr.append(nginxLocationConfig.getModule_path());
}else {
nginxLocationConfigStr.append(nginxLocationConfig.getId());
}
nginxLocationConfigStr.append("/index.html;\r\n}\r\n\r\n\r\n");
nginxLocationConfigStr.append(" set_by_lua_file $target_upstream $grayRoute ").append(nginxLocationConfig.getId()).append(" ").append(nginxLocationConfig.getId()).append(" ").append(nginxLocationConfig.getId()).append("-gray 1;\r\n");
nginxLocationConfigStr.append(" rewrite ^").append(nginxLocationConfig.getLocation_route()).append("/(.*)$ /$target_upstream/$1 break;\r\n");
nginxLocationConfigStr.append(" try_files $uri $uri/ /$target_upstream/index.html;\r\n}\r\n\r\n\r\n");
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment