Forum: NGINX How can i block these requests

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.
nilesh (Guest)
on 2012-10-29 14:10
(Received via mailing list)
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:
http://forum.nginx.org/read.php?2,232321,232321#msg-232321
Edho Arief (Guest)
on 2012-10-29 14:13
(Received via mailing list)
On Oct 29, 2012 8:09 PM, "nilesh" <nginx-forum@nginx.us> 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
Ranjib Dey (Guest)
on 2012-10-30 06:14
(Received via mailing list)
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
Edho Arief (Guest)
on 2012-10-30 06:20
(Received via mailing list)
On Tue, Oct 30, 2012 at 12:13 PM, Ranjib Dey <dey.ranjib@gmail.com>
wrote:
>
Maybe something like this will work (untested)

error_page 400 /400.html;
location = /400.html {
  access_log off;
}
This topic is locked and can not be replied to.