# How can i block these requests

**URL:** <https://www.ruby-forum.com/t/how-can-i-block-these-requests/224072>\
**Category:** NGINX\
**Created:** [October 29, 2012, 2:10pm UTC](https://www.ruby-forum.com/t/how-can-i-block-these-requests/224072 "2012-10-29T14:10:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [October 29, 2012, 2:10pm UTC](https://www.ruby-forum.com/t/how-can-i-block-these-requests/224072/1 "2012-10-29T14:10:10Z")

</div>

I am getting following access.log: and are significant in number  
RequestMethod=- RequestURI=- HTTPStatus=400 BodyBytesSent=0  
RequestTime=0.000 ResponseTime=- HTTPReferrer=“-” UserAgent=“-”  
X-Forwarded-For=- HTTPStatus=400

Does anyone know why i am getting these empty requests, and how to stop  
them.

Posted at Nginx Forum:

> **[How can i block these requests](https://forum.nginx.org/read.php?2,232321,232321#msg-232321)**
>
> I am getting following access.log: and are significant in number RequestMethod=- RequestURI=- HTTPStatus=400 BodyBytesSent=0 RequestTime=0.000 ResponseTime=- HTTPReferrer="-" UserAgent="-" X-Forwarded-For=- HTTPStatus=400 Does...

---

<div class="post-metadata">

**Author:** ![nilesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nilesh](https://www.ruby-forum.com/u/nilesh)\
**Post date:** [October 29, 2012, 2:13pm UTC](https://www.ruby-forum.com/t/how-can-i-block-these-requests/224072/2 "2012-10-29T14:13:06Z")

</div>

On Oct 29, 2012 8:09 PM, “nilesh” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am getting following access.log: and are significant in number  
> RequestMethod=- RequestURI=- HTTPStatus=400 BodyBytesSent=0  
> RequestTime=0.000 ResponseTime=- HTTPReferrer=“-” UserAgent=“-”  
> X-Forwarded-For=- HTTPStatus=400
> 
> Does anyone know why i am getting these empty requests, and how to stop  
> them.

That’s modern browser’s keepalive

> Posted at Nginx Forum:  
> [http://forum.nginx.org/read.php?2,232321,232321#msg-232321](http://forum.nginx.org/read.php?2,232321,232321#msg-232321)

---

<div class="post-metadata">

**Author:** ![nilesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nilesh](https://www.ruby-forum.com/u/nilesh)\
**Post date:** [October 30, 2012, 6:14am UTC](https://www.ruby-forum.com/t/how-can-i-block-these-requests/224072/3 "2012-10-30T06:14:29Z")

</div>

Thanks for the pointer Edho,  
right now we are getting these log entries at a rate of 5000 per hour  
per  
server, and we have multiple nginx installations, and this is almost  
flooding our centralized logging system. Is there a way to disable  
logging  
such requests, or lower the number of occurrences (like tweaking the  
keep  
alive timeout value or number of requests)?

thanks in advance  
ranjib

---

<div class="post-metadata">

**Author:** ![nilesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nilesh](https://www.ruby-forum.com/u/nilesh)\
**Post date:** [October 30, 2012, 6:20am UTC](https://www.ruby-forum.com/t/how-can-i-block-these-requests/224072/4 "2012-10-30T06:20:54Z")

</div>

On Tue, Oct 30, 2012 at 12:13 PM, Ranjib D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

Maybe something like this will work (untested)

error\_page 400 /400.html;  
location = /400.html {  
access\_log off;  
}
