|
|
发表于 2012-9-24 03:50:14
|
显示全部楼层
babyface 发表于 2012-9-24 03:02 
B Nginx增加代理真实IP判断 指定的真实IP的请求直接返回500。 并记录所有的代理IP。
这个很感兴趣,ngi ...
有的 在程序做也可以的。 下面是asp的,PHP也差不多。- Dim proxy,agent
- proxy = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
- If instr(proxy,"116.255.153.241")>0 Then
- Response.Status="301 Moved Permanently"
- Response.AddHeader "Location","http://116.255.153.241"
- Response.End
- End If
- agent=Request.ServerVariables("HTTP_USER_AGENT")
- If StrComp(agent,"Mozilla/4.0") Then
- Else
- Response.Status = "404 Not Found"
- Response.End
- End If
复制代码 |
|