Forum: NGINX How to block an IP

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Robert G. (Guest)
on 2009-04-15 22:59
Blocking an Ip address should be done like this?!

Allow from all
Deny from 59.56.109.34

Thanks!
Robert G. (Guest)
on 2009-04-15 23:06
Robert G. wrote:
> Blocking an Ip address should be done like this?!
>
> Allow from all
> Deny from 59.56.109.34
>
> Thanks!

Sorry, I mean:

location / {
  allow all;
  deny 59.56.109.34;
  ...
}
Igor S. (Guest)
on 2009-04-15 23:25
(Received via mailing list)
On Wed, Apr 15, 2009 at 09:06:14PM +0200, Robert G. wrote:

> location / {
>   allow all;
>   deny 59.56.109.34;
>   ...
> }

No, nginx stops at the first matching rule, therefore:

   deny 59.56.109.34;
   deny ...
   deny ...
   deny ...
   allow all;
This topic is locked and can not be replied to.