我如何将对使用azure webapp托管的网站的访问限制到特定国家/地区?

时间:2018-11-16 06:01:30

标签: azure azure-web-sites azure-web-app-service

我如何将对使用azure webapp托管的网站的访问限制到特定国家/地区?

2 个答案:

答案 0 :(得分:1)

您需要使用web.config或使用webapp的IP restrictions功能。

enter image description here

web.config方式:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <security>
      <!-- Full Dynamic IP Restriction Documentation: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-dynamic-ip-address-restrictions -->
      <dynamicIpSecurity> <!-- Change status code by adding the attribute: denyAction="[AbortRequest | Forbidden | NotFound | Unauthorized]" -->
        <!-- Scenario #1: Deny by Concurrent Requests -->
        <denyByConcurrentRequests enabled="true" maxConcurrentRequests="10"/>
        <!-- Scenario #2: Deny by Request Rate -->
        <denyByRequestRate enabled="true" maxRequests="10" requestIntervalInMilliseconds="2000"/>
        <!-- Scenario #3: Combine Deny by Request Rate & Deny by Concurrent Requests -->
      </dynamicIpSecurity>
    </security>
  </system.webServer>
</configuration>

答案 1 :(得分:1)

似乎Azure Web App无法仅按国家/地区限制访问。您可以尝试使用Azure CDN,它可以按国家/地区限制访问权限。