# Block ip/subnet at socket lvl

**URL:** <https://www.ruby-forum.com/t/block-ip-subnet-at-socket-lvl/211574>\
**Category:** NGINX\
**Created:** [September 7, 2011, 4:42pm UTC](https://www.ruby-forum.com/t/block-ip-subnet-at-socket-lvl/211574 "2011-09-07T16:42:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 7, 2011, 4:42pm UTC](https://www.ruby-forum.com/t/block-ip-subnet-at-socket-lvl/211574/1 "2011-09-07T16:42:19Z")

</div>

Currently Nginx can block IP on application level and thus send a 403  
forbidden message back to the client.

I wonder if there’s a way to block any request at the socket level,  
preferably not even sending a FIN message to the client but simply  
dropping the packet. Right now i’m using iptables but i’m really looking  
to have such feature on nginx itself, and if not supported right on  
current build, how could I have a hook to the socket and control it on a  
home made server module/handler?

Cheers,  
\_\_Jr

Posted at Nginx Forum:

> **[block ip/subnet at socket lvl](https://forum.nginx.org/read.php?2,214948,214948#msg-214948)**
>
> Currently Nginx can block IP on application level and thus send a 403 forbidden message back to the client. I wonder if there's a way to block any request at the socket level, preferably not even sending a FIN message to the client but simply...
