search

Home  >  Q&A  >  body text

Why does the deny ip set in nginx not take effect?

I made sure I loaded the deny.ip file. I tried to ban my own IP, but I can still access the web server. Please solve it

There is only one line written in my deny.ip: deny IP address;

漂亮男人漂亮男人2816 days ago2086

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-05-16 17:27:45

    The best configuration is posted for analysis

    allow deny is in order, if you

    allow 192.168.1.0/24
    # ...
    deny 192.168.1.5
    

    192.168.1.5is accessible

    There is another possible situation. If your server is local, assume the IP is 192.168.1.5
    Then you

    deny 192.168.1.5
    

    does not affect access via 127.0.0.1 These are two different network interfaces and vice versa

    reply
    0
  • Cancelreply