gpt4 book ai didi

Azure通过IP范围限制对Web应用程序的访问

转载 作者:行者123 更新时间:2023-12-02 08:02:51 25 4
gpt4 key购买 nike

我已经在 azure 上部署了一个 Node js Web 应用程序,我想通过 IP 地址限制对其的访问。我之前在 AWS 中使用安全组轻松完成了类似的事情。但是,我目前在免费开发平台上,当我进入 Azure 门户 GUI 中的 ip 限制设置选项卡时,它说我需要升级应用程序,因为 ip 限制在当前平台上不可用。我所构建的内容需要非常少的资源。这是一页内部静态通讯。我需要使用 azure 上的最少资源来获取 ip 限制,或者我可以使用其他路由吗?

最佳答案

在门户中配置 IP 限制所需的最少资源是 B1:

enter image description here

请阅读此处如何配置它: Azure App Service Static IP Restrictions

<小时/>

注意:您还可以通过使用 IP Security 添加 web.config 在免费层上启用 IP 限制。环境。工作示例:

<configuration>
<system.webServer>
<security>
<ipSecurity allowUnlisted="false">
<clear/>
<add ipAddress="83.116.19.53" allowed="true"/>
</ipSecurity>
</security>
</system.webServer>
</configuration>

现在您所要做的就是将 web.config 放入您的 wwwroot 目录中。您可以在部署中包含 web.config,也可以使用 Kudu 引擎手动添加它。

只需替换 <YOURSITE>与您的实际网站并点击链接:

https://<YOURSITE>.scm.azurewebsites.net/DebugConsole/?shell=powershell

enter image description here

如果您现在使用未列出的 IP 浏览应用程序,您将收到以下错误:

You do not have permission to view this directory or page.

关于Azure通过IP范围限制对Web应用程序的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52054672/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com