关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

通过修改WEB配置文件来屏蔽ITDOG的网站测速

发布时间:2023-04-06 15:05:32
1491984010112764.jpg

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站点配置文件即可,例:

image.png


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重写功能),例:

image.png


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)中即可,例:

image.png



/template/Home/8a/PC/Static