gpt4 book ai didi

asp.net-mvc - 限制 Azure 网站的 IP 地址阻止我访问本地主机

转载 作者:行者123 更新时间:2023-12-03 01:45:39 25 4
gpt4 key购买 nike

当我将网站发布到 Azure 时,我在配置文件中调用此代码来阻止除我的 IP 地址之外的所有 IP 地址。

<security>
<ipSecurity allowUnlisted="false" denyAction="NotFound">
<add allowed="true" ipAddress="98.214.211.202" subnetMask="255.255.0.0"/>
</ipSecurity>
</security>
当我将站点发布到 Azure 时,这会阻止除我之外的所有人,但是当我从本地主机启动站点进行调试时,它似乎会阻止我在我的开发计算机上。

我需要在允许的地址中包含什么 IP 地址才能解锁我的开发(本地主机)计算机?

我尝试了“127.0.0.1”,但没有成功

最佳答案

不要在本地修改 web.config,而是尝试通过 Web 应用网络配置添加 IP 限制:

enter image description here

现在您可以添加特定的 IP 地址(或范围):

enter image description here

注意:免费共享套餐不支持此功能。

关于asp.net-mvc - 限制 Azure 网站的 IP 地址阻止我访问本地主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46965603/

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