I have juste install nginx for my website, and everything is working well and very fast :)

But i have this kind of error in my access log :

IP - - [30/Dec/2011:11:06:00 +0000] - "-" 400 0 "-" "-"

IP - - [30/Dec/2011:11:06:10 +0000] - "-" 400 0 "-" "-"

IP - - [30/Dec/2011:11:06:20 +0000] - "-" 400 0 "-" "-"

IP - - [30/Dec/2011:11:06:30 +0000] - "-" 400 0 "-" "-"

This error is caused by my loadbalancer, which is one of amazon ec2 LB. And i haven't find any solution to resolve this problem.

Due to this error my log is growing very fast. What can I do for exlude it from my log ?

Thanks for your help.

And happy new year (with anticipation !!!).

  • You should solve the problem rather than treating the symptoms. What's your 'ping path' for your ELB's HTTP health check? Make sure that it begins with a slash, .e.g. "/index.html", otherwise it may not be considered a valid HTTP request and hence the 400 errors. – James Little Dec 30 '11 at 11:53
  • Ok my ping path is a html file and the path is starting with a slash. like /toto.html (and there is just some text in this file) Thanks for your help :) – Clabman Dec 30 '11 at 14:04
  • Hmm, I would be tempted to do a tcpdump of your http traffic to see what could be causing the errors; something unusual in the http headers perhaps. Also, could be related to large cookies: blog.craz8.com/articles/2009/06/17/…. – James Little Dec 31 '11 at 9:37
  • Ok, thanks for your help, i have try to play with this instructions large_client_header_buffers and it didn't change anything. Do you think i can exlude from the log just my htlm health check file ? thanks for you help – Clabman Jan 2 '12 at 14:25
  • Upgrade nginx to a newer version. see: stackoverflow.com/questions/18111260/… – Meekohi Aug 13 '13 at 21:19

If you have not stopped these entries by adjusting your LB's polling of your server, you can use Apache's SetEnvIf to do conditional logging.


I have some clients who use this for certain image directories. They have graphic rich sites and images are >95% of the hits. The logs were GB's per day before excluding the images.

In your case, you could probably exclude by IP address.

EDIT: Sorry mis-read. Nginx has a log not found option:


This turns off 404 in the error log. You can then use a location directive:

location ~* ^.+\.(jpg|jpeg|gif)$ 
{ root /var/www/html; 
*access_log off;* 
  • Thanks, but i am working with nginx.... – Clabman Jan 2 '12 at 14:27
  • Sorry misread. Thought you were using Nginx to LB to Apache systems. – jeffatrackaid Jan 2 '12 at 16:36
  • thanks for your edit, I am trying to use this option. thanks again, i think it is the solution for my case ! – Clabman Jan 3 '12 at 15:22
  • 2
    This is not a solution, it only removes 404 errors, not 400 errors. – Meekohi Aug 7 '13 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.