Log config - can I ignore requests from a certain IP?

Yanni Mac lists at ruby-forum.com
Sat Dec 6 17:24:38 MSK 2008


Merlin wrote:
> This problem comes up often, and the solution is usually to turn off 
> access
> log for that location only; something like the following is very 
> efficient:
> ...
> server {
>   ...
>   location = /health.html {
>     access_log off;
>   }
>   ...
> }

That does not work.  I think the load balancer is doing some kind of 
incomplete request to the health file on nginx.  I am seeing 400 errors 
in the log and no log entries for /loadcheck.html.

12.123.123.1 - - [06/Dec/2008:09:08:28 -0500] 400 "-" 0 "-" "-" "-"

I tried something like this, but not working either:

    error_page  400 /400;
    location = /400 {
      access_log off;
    }

I also tried to put a condition when $status is 400, but nginx gave an 
error that said access_log was not allowed in this block of code.

Let me know if you guys have any other ideas.  Thanks!
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list