Is it possible to add security section in web.config to external file

后端 未结 2 1469
無奈伤痛
無奈伤痛 2021-01-06 14:56

I need block a huge IP list via config file


      
                  
        

        
2条回答
  •  庸人自扰
    2021-01-06 15:33

    c:\Windows\system32\inetsrv\config\applicationHost.config

    change the configuration for the web server:

    from:

    < section name="ipSecurity" overrideModeDefault="Deny" / > 
    

    to:

    < section name="ipSecurity" overrideModeDefault="Allow" / > 
    

    and your web.config

    < configuration > 
    < system.webServer > 
    < security > 
    < ipSecurity configSource="fileWithIps.config" / > 
    < /security > 
    < /system.webServer > 
    < /configuration > 
    

提交回复
热议问题