Sru*_*thi 14 asp.net iis web-config
这是我的web.config,它有一些阻止Ipaddress的标签
<configuration>
<connectionStrings>
...
</connectionStrings>
<appSettings>
....
</appSettings>
<runtime>
....
</runtime>
<system.webServer>
<security>
<ipSecurity allowUnlisted="false">
<clear/>
<add ipAddress="127.0.0.1" allowed="true"/>
<add ipAddress="83.116.19.53" allowed="true"/>
</ipSecurity>
</security>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我的目的是阻止除上述之外的任何其他IP.以上是我希望从中访问网站的唯一IP地址.但是使用"ipSecurity"标签我总是得到500 - 内部服务器错误,没有它,网站运行正常.
我确保在服务器上安装了"IP和域限制".如果我遗失任何东西,请告诉我.谢谢.
Sum*_*mit 31
对于遇到此问题的其他人.问题的原因是功能委派不允许该功能由web.config管理.
修理:
验证是否已为web.config管理启用该功能
希望这有助于其他人.
Gre*_*ell 19
对于Windows 10和Visual Studio 2015,请注意ApplicationHost.config文件已重定位到项目文件夹层次结构中的.vs\config文件夹.您将需要编辑在那里找到的ApplicationHost.config文件的项目特定版本 ...
<section name="ipSecurity" overrideModeDefault="Allow" />
Run Code Online (Sandbox Code Playgroud)
如果您只编辑Documents\IISExpress文件夹中的ApplicationHost.config,这不会影响您现有的应用程序(在我的情况下是MVC5应用程序).
小智 11
打开applicationHost.config文件(位于%windir%\ system32\inetsrv\config\applicationHost.config)并编辑ipSecurity部分.
改变这一行:
<section name="ipSecurity" overrideModeDefault="Deny" />
Run Code Online (Sandbox Code Playgroud)
至:
<section name="ipSecurity" overrideModeDefault="Allow" />
Run Code Online (Sandbox Code Playgroud)
在 System.Webserver 标签之外试试这个
<location path="Default WebSite">
<system.webServer>
<security>
<ipSecurity allowUnlisted="false">
<clear/>
<add ipAddress="127.0.0.1" allowed="true"/>
<add ipAddress="83.116.19.53" allowed="true"/>
</ipSecurity>
</security>
</system.webServer>
</location>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
15280 次 |
最近记录: |