更改Azure限制行为

问题描述 投票:1回答:1

我有一个限制访问的网站。只允许许多IP访问该站点。我已为网站配置了访问限制,以便只有指定的客户端才能访问该应用程序。

问题是所有被拒绝的客户端都收到403 http响应状态代码,并带有以下消息:

错误403 - 此Web应用程序已停止。

我怎么能改变这种行为,以便denid客户端根本没有收到任何响应?

azure azure-web-sites firewall http-status-code-403 restriction
1个回答
1
投票

如何使用“动态IP限制功能”。 https://azure.microsoft.com/en-us/blog/confirming-dynamic-ip-address-restrictions-in-windows-azure-web-sites/

例:

<system.webServer>
   <security>
      <ipSecurity allowUnlisted="false" denyAction="NotFound">
         <add allowed="true" ipAddress="1.2.3.4"subnetMask="255.255.0.0"/>
      </ipSecurity>
   </security>
</system.webServer>

denyAction的允许值为:

  • AbortRequest(返回HTTP状态代码0)
  • 未授权(返回HTTP状态代码401)
  • Forbidden(返回HTTP状态代码403)。 请注意,这是默认设置。
  • NotFound(返回HTTP状态代码404)
© www.soinside.com 2019 - 2024. All rights reserved.