是否有可能在web.config中添加安全部分外部文件 [英] Is it possible to add security section in web.config to external file
本文介绍了是否有可能在web.config中添加安全部分外部文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要通过拦截配置文件了巨大的IP列表
I need block a huge IP list via config file
<security>
<ipSecurity allowUnlisted="true">
<clear />
<add ipAddress="1.0.1.0" subnetMask="255.255.255.0" />
<add ipAddress="1.0.2.0" subnetMask="255.255.254.0" />
<add ipAddress="1.0.8.0" subnetMask="255.255.248.0" />
<add ipAddress="1.0.32.0" subnetMask="255.255.224.0" />
...
</ipSecurity>
</security>
是否有可能在web.config中添加安全部分外部文件?
Is it possible to add security section in web.config to external file ?
推荐答案
C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config
c:\Windows\system32\inetsrv\config\applicationHost.config
更改配置Web服务器:
change the configuration for the web server:
从:
< section name="ipSecurity" overrideModeDefault="Deny" / >
到
< section name="ipSecurity" overrideModeDefault="Allow" / >
和你的web.config
and your web.config
< configuration >
< system.webServer >
< security >
< ipSecurity configSource="fileWithIps.config" / >
< /security >
< /system.webServer >
< /configuration >
这篇关于是否有可能在web.config中添加安全部分外部文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文