Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

This is my web.config which has some tags for blocking 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>

My intention is to block any other IP except the above. The above is the only Ip address I want the website to be accessible from . But with "ipSecurity" tag I am always getting 500 - Internal server error and the site runs fine without it.

I have made sure that "IP and Domains Restrictions" are installed on the server. Please let me know if I am missing anything. Thank you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
686 views
Welcome To Ask or Share your Answers For Others

1 Answer

For others that run into this issue. The cause of the issue is that Feature Delegation doesn't allow the feature to be managed by web.config.

To Fix:

Verify that the Feature is enabled for web.config management

  • In IIS 7, click on the root server
  • Double click Feature Delegation (under management)
  • Scroll down to IPv4 Address and Domain Restrictions
    • Change the delegation to Read/Write (in my case it was Read Only, which was the issue)

Hope this helps someone else.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...