1

Does nginx have an option to ignore health checks or buckets from load balancer against nodes? There are thousands of entries like

93.190.2.176 - - [24/Jul/2012:08:56:59 +0200] "-" 400 0 "-" "-"

in my access.log which are useless to me.

Thanks for a tip

3 Answers 3

1
server {
    listen 80 default_server;
    server_name _;
    access_log  off;
}
6
  • doesn't this turn off all the logs?!
    – ledy
    Jul 24, 2012 at 9:33
  • If you have another server sections with relevant server_name, then it turns off only for requests those don't reach one. Did you read the first link above?
    – VBart
    Jul 24, 2012 at 9:37
  • Note, that you can also have server section with server_name ''; and server_name *;
    – VBart
    Jul 24, 2012 at 9:38
  • yes, but i can not see if the ip or which server_name ist called. the log does not tell me. btw. i do not have a index file on this server, it's a blank page and only the health check is calling /
    – ledy
    Jul 24, 2012 at 9:42
  • Again. Do you read the docs? default_server means that this server section will be chosen by default even if no data were sent.
    – VBart
    Jul 24, 2012 at 9:46
0

You can turn off access_log in your global server config file and turn it on only in selected locations.

1
  • No, the log is fine. However, the empty entries are useless. No chance to filter and leave them?
    – ledy
    Jul 24, 2012 at 7:17
0

If you can configure your health check to pull a particular url then you can turn off access logging for it specifically

location = /health.php {

 access_log     off;
 ...
}
2
  • That's probably a TCP, not HTTP, healthcheck (hence the 400 status code), and so there's no URL to match unfortunately.
    – mgorven
    Jul 24, 2012 at 7:20
  • @mgorven: That's why I said if ... some LBs let you set a http health check.
    – user9517
    Jul 24, 2012 at 7:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .