Is it possible to make part of a site on IIS only viewable from localhost?

前端 未结 10 803
后悔当初
后悔当初 2020-12-15 05:19

We\'ve got a webserver running IIS. We\'d like to run maybe a shared blog or something to keep track of information. Because of security issues, we\'d like for that part to

10条回答
  •  -上瘾入骨i
    2020-12-15 05:42

    Should anyone wish to do this on the command line, this appears to work on IIS 7+

    %windir%\system32\inetsrv\appcmd.exe set config "Default Web Site" -section:system.webServer/security/ipSecurity /+"[ipAddress='0',allowed='False']" /commit:apphost
    %windir%\system32\inetsrv\appcmd.exe set config "Default Web Site" -section:system.webServer/security/ipSecurity /+"[ipAddress='127.0.0.1',allowed='True']" /commit:apphost
    

    Reference

    I initially wanted to do this in web.config to ease distribution, and it looked like the following might work:

    
                            
             
                
        
    
    

    but as you need to unlock the function in the central IIS config anyway there was no advantage over making the change directly using the first commands.

提交回复
热议问题