restricting IP security

回眸只為那壹抹淺笑 提交于 2019-12-08 11:25:44

问题


Having an issue with restricting IP security. I have made a web.config file and placed it in the folder I am trying to restrict see below:

<?xml version="1.0" encoding="UTF-8"?>
  <configuration>
   <system.webServer>
    <security>
      <ipSecurity allowUnlisted="false" enableProxyMode="true" denyAction="Forbidden">            
        <clear />           
        <add ipAddress="123.456.789" allowed="true" />
    </ipSecurity>
   </security>
 </system.webServer>
</configuration>

I have also adjusted the applicationHost.config to:

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

However when browsing to a file in that folder I get a 403. I have restarted IIS and IP address is correct.

What am I missing?


回答1:


Check the client IP (c-ip) in IIS logs and add that to ip - restrictions rules.



来源:https://stackoverflow.com/questions/39037481/restricting-ip-security

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!