我可以将谁访问我的Azure网站限制在美国吗? [英] Can I restrict who accesses my Azure website to people in the US?

查看:52
本文介绍了我可以将谁访问我的Azure网站限制在美国吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将只能浏览和访问我的网站的人员限制在美国!我知道我可以将IP地址限制为仅在我的web.config文件中提供的IP地址.是否可以在下面使用某些子网掩码或某些东西来定义所有美国ip地址,或者可以在Azure门户中配置一些Azure设置?

I want to limit the people who can see and visit my website to only those in the US! I know I can restrict IP addresses to only those I give in my web.config file. Is there some subnet mask or something I can use below to define all US ip addresses or is there some Azure settings I can configure in the Azure portal?

例如

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

推荐答案

您无法在Azure门户中配置任何Azure设置来限制来自任何区域的IP地址访问.

There is no Azure setting you can configure in the Azure portal to restrict access based on IP address from any region.

我建议您可以使用一些nuget程序包,例如 MaxMind.GeoIP2 可以提供 GeoIP查找功能,以根据客户端IP地址获取位置信息,例如国家和城市.

I suggest you could use some nuget package such as MaxMind.GeoIP2 which can provide GeoIP lookup functionality to get the location information such as country and city based on the client IP address.

这种方式比必须找出美国的所有IP地址范围和子网掩码并将其列入白名单更好.

This way would be better than having to find out and whitelist all the IP addresses range and subnet masks for U.S.

这篇关于我可以将谁访问我的Azure网站限制在美国吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆