IIS启用泛解析后,要是某个IP指向该服务器,该服务器就会被识别为绑定了改域名,要是该是没有备案的那么服务器就有麻烦了。其实我们可以实行白名单制度,对制定域名实行处理,其他域名避开,浏览器返回 http 400就行。 如下是解决办法:

如:服务器只让 ynshangji.com 和 zhaoshang100.com 连接,那么我们可以这样设置:

<%
if instr(Request.ServerVariables("HTTP_HOST"),"ynshangji.com")=0  and instr(Request.ServerVariables("HTTP_HOST"),"zhaoshang100.com")=0 then
Response.Status="400 Bad Request"
Response.End
end if
%>

 

 

if (Request.ServerVariables["Http_Host"].Trim().IndexOf("91qiye.com") == -1)//非91qiye.com
        {
            Response.Status = "400 Bad Request";
            Response.End();
        }
        else

 

        { Response.Write("sd"); }

 

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2022-01-07
  • 2021-09-14
  • 2022-12-23
  • 2021-06-28
  • 2021-05-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2021-10-21
  • 2021-09-02
相关资源
相似解决方案