mirror of
https://github.com/ctripcorp/zeus.git
synced 2024-09-22 00:26:05 +08:00
add bastion header
This commit is contained in:
parent
84e470baf8
commit
611bbed053
|
@ -88,10 +88,15 @@ public class LocationConf {
|
|||
.append("if ( $upstream = \"\")")
|
||||
.append("{\nset $upstream ").append(upstreamName).append(";\n}\n");
|
||||
String wl = whiteList.get();
|
||||
if (null != wl && !wl.trim().equals("")&&!wl.contains("\""))
|
||||
if (null == wl || wl.isEmpty() || wl.trim().equals("") || wl.contains("\""))
|
||||
{
|
||||
sb.append("if ( $remote_addr !~* \"").append(wl).append("\")")
|
||||
.append("{\nset $upstream ").append(upstreamName).append(";\n}\n");
|
||||
wl="denyAll";
|
||||
}else if (wl.equals("allowAll")){
|
||||
wl="";
|
||||
}
|
||||
sb.append("if ( $remote_addr !~* \"").append(wl).append("\")")
|
||||
.append("{\nset $upstream ").append(upstreamName).append(";\n}\n");
|
||||
sb.append("if ( $upstream != ").append(upstreamName).append(" ){\n")
|
||||
.append("add_header Bastion $cookie_bastion;\n}\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue