Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure nginx to not log ELB secondary healthcheck

Amazon Elastic Load Balancer (ELB) performs periodic health checks:

In addition to the health check you configure for your load balancer, a second health check is performed by the service to protect against potential side-effects caused by instances being terminated without being deregistered. To perform this check, the load balancer opens a TCP connection on the same port that the health check is configured to use, and then closes the connection after the health check is completed.

nginx logs these events with a 400 error, which happen many times per minutes:

[07/Aug/2013:18:32:27 +0000] "-" 0.000 400 0 "-" "-" "-"

how can I configure nginx to not log these events?

like image 255
Meekohi Avatar asked Aug 07 '13 18:08

Meekohi


1 Answers

The solution is to not use legacy unsupported versions of nginx. Starting from version 1.3.15 (pretty old one), nginx does not log the 400 errors in such cases.

See changelog for information: http://nginx.org/en/CHANGES

*) Change: opening and closing a connection without sending any data in
   it is no longer logged to access_log with error code 400.
like image 145
VBart Avatar answered Nov 19 '22 14:11

VBart