Nginx服务器(请将代码放置于配置文件的 server{} 节点中):
屏蔽快速测试模式:
1 2 3 | if ($http_checkmode = 'fast' ) { return 500; } |
屏蔽缓慢测试模式:
1 2 3 | if ($http_checkmode = 'slow' ) { return 500; } |
屏蔽所有模式:
1 2 3 | if ($http_checkmode) { return 500; } |
将以上代码根据自己需求选择一个复制到Nginx站点配置文件即可,例:
IIS服务器(IIS7.5及以上,请将代码放置于配置文件的<rewrite><rules>节点中):
屏蔽快速测试模式:
1 2 3 4 5 6 7 | <rule name= "itdog_filter" patternSyntax= "Wildcard" stopProcessing= "true" > <match url= "*" /> <conditions> <add input= "{HTTP_checkmode}" pattern= "fast" /> < /conditions > <action type = "CustomResponse" statusCode= "500" statusReason= "ITDOG filter" statusDescription= "ITDOG filter" /> < /rule > |
屏蔽缓慢测试模式:
1 2 3 4 5 6 7 | <rule name= "itdog_filter" patternSyntax= "Wildcard" stopProcessing= "true" > <match url= "*" /> <conditions> <add input= "{HTTP_checkmode}" pattern= "slow" /> < /conditions > <action type = "CustomResponse" statusCode= "500" statusReason= "ITDOG filter" statusDescription= "ITDOG filter" /> < /rule > |
屏蔽所有模式:
1 2 3 4 5 6 7 8 | <rule name= "itdog_filter" patternSyntax= "Wildcard" stopProcessing= "true" > <match url= "*" /> <conditions logicalGrouping= "MatchAny" > <add input= "{HTTP_checkmode}" pattern= "fast" /> <add input= "{HTTP_checkmode}" pattern= "slow" /> < /conditions > <action type = "CustomResponse" statusCode= "500" statusReason= "ITDOG filter" statusDescription= "ITDOG filter" /> < /rule > |
将以上代码根据需求选择一个复制到IIS站点配置文件(web.config)中即可(注意:IIS需要启用URL重写功能),例:
Apache服务器(将代码放置在站点根目录下的.htaccess文件中):
屏蔽快速测试模式:
1 2 3 | RewriteEngine On RewriteCond %{HTTP:checkmode} ^fast$ RewriteRule ^ - [R=500] |
屏蔽缓慢测试模式:
1 2 3 | RewriteEngine On RewriteCond %{HTTP:checkmode} ^slow$ RewriteRule ^ - [R=500] |
屏蔽所有模式:
1 2 3 4 | RewriteEngine On RewriteCond %{HTTP:checkmode} ^fast$ [OR] RewriteCond %{HTTP:checkmode} ^slow$ RewriteRule ^ - [R=500] |
将以上代码根据需求选择一个复制到Apache站点根目录(.htaccess)中即可,例:
Copyright © 2013-2021 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号