gpt4 book ai didi

web-config - 当 web.config 包含 ipSecurity 权限时允许 "localhost"在 iisexpress 中运行

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

我刚刚将其添加到我的 web.config 中:

<security>
<ipSecurity allowUnlisted="false">
<!-- The following IP addresses are granted access, all else denied -->
<add allowed="true" ipAddress="123.123.105.0" subnetMask="255.255.255.0" />
<add allowed="true" ipAddress="123.123.100.0" subnetMask="255.255.255.0" />
</ipSecurity>
</security>

仅在特定的 IP 范围内按预期工作。但是,现在当我通过 localhost 通过 iisExpress 在 Visual Studio 中测试这一点时,它当然会给我带来问题。这是我收到的 500.19 错误:

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

我已经在服务面板中的本地计算机上设置了 IPSecurity,以便启用它,并且我已经在 ipSecurity block 中使用了选项,例如添加“localhost”作为域名值 - 但可惜没有运气。 ....帮助我 StackOverflow,你是我唯一的希望! ;)

最佳答案

我刚刚遇到了同样的情况。我用 google 搜索了一下,发现您所要做的就是编辑此处找到的 IIS Express 的 applicationhost.config 文件:

%userprofile%\Documents\IISExpress\config\applicationhost.config

打开它并查找 system.webServer 部分中的 ipSecurity 部分,并将 overrideModeDefault 从“拒绝”更改为“允许”。您无需从 Windows 功能添加 IIS IP 安全性

<sectionGroup name="system.webServer">
<sectionGroup name="security">
...
<section name="ipSecurity" overrideModeDefault="Allow" />
...
</sectionGroup>
</sectionGroup>

希望这有帮助!

注意:对于 Windows 10Visual Studio 2015(或更高版本),请注意 ApplicationHost.config 文件已重新定位到 .vs\项目文件夹层次结构中的 config 文件夹

关于web-config - 当 web.config 包含 ipSecurity 权限时允许 "localhost"在 iisexpress 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22508700/

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