Microsoft Azure-允许特定IP访问特定页面

时间:2019-01-31 12:15:04

标签: azure azure-web-sites azure-application-gateway

我是Microsoft Azure的新手,我们在将网站特定页面的访问限制为特定IP地址时遇到问题。我们想做的是只有特定的IP地址才能访问某些页面,例如/ user,/ admin。我们不知道是否有办法使用Web.Config允许特定的IP。

希望您能帮助我。谢谢

2 个答案:

答案 0 :(得分:1)

我认为您需要查看Application Gateway以将IP限制为特定路由。

https://docs.microsoft.com/en-us/azure/application-gateway/tutorial-restrict-web-traffic-powershell

答案 1 :(得分:1)

可以在Web配置中执行此操作: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/ipsecurity/

示例:Is it possible to configure a location in Web.config to only allow local connections

如果要在特定路由上允许特定IP地址,则可以创建这样的自定义IP过滤器属性,并将其放置在控制器上: Restrict access to a specific controller by IP address in ASP.NET MVC Beta

相关问题