Posted By

augoisms on 01/22/16


Tagged

webconfig


Versions (?)

IP Restrict Directory


 / Published in: XML
 

place web.config in which ever directory you would like to restrict

  1. <?xml version="1.0"?>
  2. <configuration>
  3. <system.webServer>
  4. <security>
  5. <ipSecurity allowUnlisted="false"> <!-- this line blocks everybody, except those listed below -->
  6. <clear/> <!-- removes all upstream restrictions -->
  7. <add ipAddress="127.0.0.1" allowed="true"/> <!-- allow requests from the local machine -->
  8. <add ipAddress="83.116.19.53" allowed="true"/> <!-- allow the specific IP of 83.116.19.53 -->
  9. </ipSecurity>
  10. </security>
  11. <modules runAllManagedModulesForAllRequests="true"/>
  12. </system.webServer>
  13. </configuration>

Report this snippet  

You need to login to post a comment.