Authored by zhouxiang

nginx lua切换

... ... @@ -14,8 +14,8 @@ import java.util.Map;
public class HandlebarsUtils {
private static Handlebars handlebars = new Handlebars();
static {
handlebars.setStartDelimiter("<<<");
handlebars.setEndDelimiter(">>>");
handlebars.setStartDelimiter("{@{");
handlebars.setEndDelimiter("}@}");
}
public static String replace(Map<String, Object> obj,String tempfilePath,String createFileName) {
... ...
... ... @@ -114,14 +114,14 @@ http
upstream apigateway {
<<<#each ips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
{@{#each ips}@}server {@{this}@}:8080 max_fails=5 fail_timeout=3s;
{@{/each}@}
keepalive 32;
}
upstream grayapigateway {
<<<#each grayips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
{@{#each grayips}@}server {@{this}@}:8080 max_fails=5 fail_timeout=3s;
{@{/each}@}
keepalive 32;
}
... ...
... ... @@ -7,7 +7,7 @@ local context=ngx.lookup_context
context.dns_server={"114.114.114.114"}
-- 1:aws ,2:qq ,3:aws+qq
context.cloud_flag=<<<flag>>>
context.cloud_flag={@{flag}@}
--add 20160823 notLogin=aws/tencent
context.strategy_param={["model"]=1024,["tencentMax"]=128,["notLogin"]="aws"}
... ...
... ... @@ -112,15 +112,15 @@ http
}
upstream apigateway {
<<<#each ips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
{@{#each ips}@}server {@{this}@}:8080 max_fails=5 fail_timeout=3s;
{@{/each}@}
keepalive 32;
}
upstream grayapigateway{
# ip_hash;
<<<#each grayips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
{@{#each grayips}@}server {@{this}@}:8080 max_fails=5 fail_timeout=3s;
{@{/each}@}
keepalive 32;
}
... ...
... ... @@ -18,7 +18,7 @@ public class CommodUtil {
private static Logger logger = LoggerFactory.getLogger(CommodUtil.class);
public static final String BASE_DIR = "/bin/sh " + System.getenv("HOME") + "/ops_sh/";
public static final String BASE_DIR = System.getenv("HOME") + "/ops_sh/";
/**
* NGINX 查询切换脚本
... ...