Filtering out non-HTTP requests (400 errors)

Grzegorz Nosek grzegorz.nosek at
Mon Jan 11 19:28:24 MSK 2010

Hi all,

I'm having a silly problem I'd rather ask about before spending hours.

I have a bunch of Nginxes serving a webservice behind a haproxy, whose
TCP checks (quite naturally) cause lots of 400 errors in access.log and
I'd like to filter them out. However, I cannot simply drop e.g. requests
without a Host: header as the header is universally ignored both by the
clients and the servers, so I can't really tell what's in it (and
frankly I don't care too much as there are no vhosts there).

So, is there a simple way to filter out non-HTTP requests from the
access log? doesn't seem
to work unfortunately (I tried something along this way already and
checked this exact config now).

The machines are running Nginx 0.6.39-2.el5 (straight from EPEL) and I'd
rather keep it that way (otherwise I'd probably have hacked it out of the
source by now ;))

Best regards,
 Grzegorz Nosek

More information about the nginx mailing list