apache、iis6、ii7独立ip主机屏蔽限制ip访问(适用vps云主机)注: Linux下 规则文件.htaccess(手工创建.htaccess文件到站点根目录) <IfModule mod_rewrite.c> RewriteEngine On #Block ip RewriteCond %{http:X-Forwarded-For} ^(8.8.4.4|8.8.8\.) [OR] RewriteCond %{REMOTE_ADDR} ^(8.8.4.4|8.8.8\.) [OR] RewriteCond %{http:X-Real-IP} ^(8.8.4.4|8.8.8\.) [NC] RewriteRule (.*) - [F] </IfModule> windows2003下 规则文件httpd.conf
#Block ip RewriteCond %{http:X-Forwarded-For} ^(8.8.4.4|8.8.8\.) [OR] RewriteCond %{REMOTE_ADDR} ^(8.8.4.4|8.8.8\.) [OR] RewriteCond %{http:X-Real-IP} ^(8.8.4.4|8.8.8\.) [NC] RewriteRule (.*) - [F] windows平台IIS7及以上版本 规则文件web.config (手工创建web.config文件到站点根目录) <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="band ip"> <match url="(.*)" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_X_FORWARDED_FOR}" pattern="^(8.8.4.4|8.8.8\.)" ignoreCase="false" /> <add input="{REMOTE_ADDR}" pattern="^(8.8.4.4|8.8.8\.)" ignoreCase="false" /> <add input="{HTTP_X_REAL_IP}" pattern="^(8.8.4.4|8.8.8\.)" ignoreCase="false" /> </conditions> <action type="AbortRequest" /> </rule> </rules> </rewrite> </system.webServer> </configuration> nginx宝塔面板设置屏蔽IP规则,可以在宝塔面板-》对应站点伪静态处设置: if ( $http_x_forwarded_for ~* '8.8.8.8|114.114.114.114') {return 444;} if ( $remote_addr ~* '8.8.8.8|114.114.114.114') {return 444;} if ( $http_x_real_ip ~* '8.8.8.8|114.114.114.114') {return 444;}
|
|||||
>> 相关文章 | |||||
关于我们
|
联系我们
|
付款方式
|
人才招聘
|
友情链接
|
域名资讯
|
提交工单
|
我要评价
|
投诉建议
|
域名投诉
|
网站备案
|
百科知识
|
手机站
《中华人民共和国增值电信业务经营许可证》编号:川B1.B2-20080058号 蜀ICP备12028237号
电话总机:028-6277****(20线) 抱歉,当前是午餐时间,请在13:00以后咨询。若有网站打不开、网络中断等紧急问题请致电028-62778877-7。 400电话:400-028-**** 抱歉,当前是午餐时间,请在13:00以后咨询。若有网站打不开、网络中断等紧急问题请致电028-62778877-7。
400-028-****
028-6277****
抱歉,当前是午餐时间,请在13:00以后咨询。若有网站打不开、网络中断等紧急问题请致电028-62778877-7