我試圖使用IIS Dynamic IP Restrictions來限制來自同一IP的請求。如果我從IIS用戶界面編輯動態限制設置,則模塊正在運行,並且請求被很好地限制。這很好,但我需要在不同的網址上有不同的價格。例如,登錄應該比靜態資源更嚴格。我試圖在web.config中使用locations
來實現此目的。web.config位置中的IIS動態IP限制
<configuration>
<location path="foo">
<system.webServer>
<security>
<dynamicIpSecurity enableLoggingOnlyMode="true">
<denyByRequestRate enabled="true" maxRequests="1"
requestIntervalInMilliseconds="5000" />
</dynamicIpSecurity>
</security>
</system.webServer>
</location>
</configuration>
不幸的是,這不適用。我很確定它與我的應用程序無關,因爲它在具有一個HTML文件的靜態網站上也不起作用。我也很確定位置路徑是正確的,因爲如果我添加...<deny users="*" />
,請求被阻止。
您是否嘗試將'enableLoggingOnlyMode'設置爲'false'?根據[本頁](https://www.iis.net/configreference/system.webserver/security/dynamicipsecurity)請求在設置爲「true」時實際上並未被阻止。 – user1429080
謝謝,是的,我試過真,假,也沒有屬性。不幸的是,這對節流沒有影響。 –