这是我的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和域限制".如果我遗失任何东西,请告诉我.谢谢.