apache、iis6、ii7獨立ip主機屏蔽限制ip訪問(適用vps云主機)注: Linux下 規(guī)則文件.htaccess(手工創(chuàng)建.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下 規(guī)則文件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及以上版本 規(guī)則文件web.config (手工創(chuàng)建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規(guī)則,可以在寶塔面板-》對應站點偽靜態(tài)處設置: 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;}
|
|||||
>> 相關文章 | |||||
關于我們
|
聯(lián)系我們
|
付款方式
|
人才招聘
|
友情鏈接
|
域名資訊
|
提交工單
|
我要評價
|
投訴建議
|
域名投訴
|
網站備案
|
百科知識
|
手機站
《中華人民共和國增值電信業(yè)務經營許可證》編號:B1-20172600 川B1-20080058 蜀ICP備12028237號
《中華人民共和國互聯(lián)網域名服務許可證》編號:川 D3-20220002
電話總機:028-62778877(20線) 400電話:400-028-5800
400-028-5800
028-62778877
您好,非正常上班時間若有緊急技術問題,請撥總機后按7號鍵, 其他問題請?zhí)峤还位蛟谏习鄷r間聯(lián)系,謝謝支持!