【发布时间】:2017-03-07 10:17:45
【问题描述】:
我正在尝试使用 IIS Dynamic IP Restrictions 来限制来自同一 IP 的请求。如果我从 IIS UI 编辑动态限制设置,我的模块正在运行,并且请求会受到很好的限制。这很好,但是我需要在不同的 URL 上有不同的费率。例如,登录应该比静态资源更严格。我正在尝试在 web.config 中使用 locations 来实现这一点。
<configuration>
<location path="foo">
<system.webServer>
<security>
<dynamicIpSecurity enableLoggingOnlyMode="true">
<denyByRequestRate enabled="true" maxRequests="1"
requestIntervalInMilliseconds="5000" />
</dynamicIpSecurity>
</security>
</system.webServer>
</location>
</configuration>
很遗憾,这不适用。我很确定它与我的应用程序无关,因为它在具有一个 HTML 文件的静态 Web 上也不起作用。我也很确定位置路径是正确的,因为如果我添加...<deny users="*" />,请求就会被阻止。
【问题讨论】:
-
您是否尝试将
enableLoggingOnlyMode设置为false?根据this page,当设置为true时,请求实际上并没有被阻塞。 -
谢谢,是的,我试过 true、false,也没有属性。不幸的是,这对节流没有影响。
标签: asp.net iis ip-restrictions