# Q about don't log 400 errors

**URL:** <https://www.ruby-forum.com/t/q-about-dont-log-400-errors/222935>\
**Category:** NGINX\
**Created:** [September 15, 2012, 12:53pm UTC](https://www.ruby-forum.com/t/q-about-dont-log-400-errors/222935 "2012-09-15T12:53:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 15, 2012, 12:53pm UTC](https://www.ruby-forum.com/t/q-about-dont-log-400-errors/222935/1 "2012-09-15T12:53:09Z")

</div>

Hi,

I have follow the instruction on

[http://wiki.nginx.org/HWLoadbalancerCheckErrors](http://wiki.nginx.org/HWLoadbalancerCheckErrors)

but I still get the 400 entries in the access log.

Please can anybody help, thanks.

Cheers Aleks

/opt/nginx/installed/sbin/nginx -V  
nginx version: nginx/1.3.4  
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)  
TLS SNI support enabled  
configure arguments: --prefix=/opt/nginx/installed  
–conf-path=/opt/nginx/conf/nginx.conf --with-file-aio  
–with-http\_ssl\_module --with-http\_realip\_module  
–with-http\_geoip\_module --with-http\_gzip\_static\_module  
–with-http\_secure\_link\_module --with-http\_stub\_status\_module  
–without-http\_ssi\_module  
–http-client-body-temp-path=/opt/global\_dir/temp\_paths/client-body  
–http-proxy-temp-path=/opt/global\_dir/temp\_paths/http-proxy  
–http-fastcgi-temp-path=/opt/nginx/global\_dir/fastcgi  
–http-uwsgi-temp-path=/opt/global\_dir/temp\_paths/uwsgi  
–http-scgi-temp-path=/opt/global\_dir/temp\_paths/scgi --with-debug  
–pid-path=/opt/global\_dir/logs  
–error-log-path=/opt/global\_dir/logs/default\_error.log  
–http-log-path=/opt/global\_dir/logs/default\_access.log  
–pid-path=/opt/nginx/logs/nginx.pid

### nginx.conf

http {  
…  
geo $remote\_addr $is\_lb\_400 {  
default 0;  
127.0.0.1/32 1;  
}  
…  
server {  
…  
error\_page 400 /400;

```
     location = /400 {
       if ($is_lb_400) {
         access_log off;
       }
       return 400;
     }
 ...

```

}

### 

### 

2012/09/15 12:46:22 [debug] 24085#0: \*131110 accept: 127.0.0.1 fd:4  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 event timer add: 4:  
60000:1347706042790  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 epoll add event: fd:4 op:1  
ev:80000001  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 malloc:  
0000000000DDE9B0:1280  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 posix\_memalign:  
0000000000E1DA80:256 @16  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 malloc:  
0000000000E1DB90:1024  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 posix\_memalign:  
0000000000D56690:4096 @16  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 http process request line  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 recv: fd:4 0 of 1024  
2012/09/15 12:46:22 [info] 24085#0: \*131110 client prematurely closed  
connection while reading client request line, client: 127.0.0.1, server:

> **[Website Domain Names, Online Stores & Hosting](https://www.domain.com/)**
>
> Finding the perfect website domain is as easy as 1-2-3. Buy a domain name, build and host a website, and enjoy our professional online marketing tools.

2012/09/15 12:46:22 [debug] 24085#0: \*131110 http finalize request:  
400, “?” a:1, c:1  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 http terminate request  
count:1  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 http terminate cleanup  
count:1 blk:0  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 http request count:1 blk:0  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 http close request  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 http log handler  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 free: 0000000000D56690,  
unused: 2031  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 close http connection: 4  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 event timer del: 4:  
1347706042790  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 reusable connection: 0  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 free: 0000000000E1DB90  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 free: 0000000000DDE9B0  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 free: 0000000000D54AB0,  
unused: 8  
2012/09/15 12:46:22 [debug] 24085#0: \*131110 free: 0000000000E1DA80,  
unused: 128

###

---

<div class="post-metadata">

**Author:** ![Aleksandar\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@Aleksandar\_L](https://www.ruby-forum.com/u/Aleksandar_L)\
**Post date:** [September 18, 2012, 9:35am UTC](https://www.ruby-forum.com/t/q-about-dont-log-400-errors/222935/2 "2012-09-18T09:35:41Z")

</div>

Hello!

On Sat, Sep 15, 2012 at 12:52:38PM +0200, Aleksandar L. wrote:

> Hi,
> 
> I have follow the instruction on
> 
> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HWLoadbalancerCheckErrors)
> 
> but I still get the 400 entries in the access log.
> 
> Please can anybody help, thanks.

[…]

> server {  
> …  
> error\_page 400 /400;

Is it the default server? Note that it will work only in default  
one, as there is no Host header available to find out name-based  
virtual host.

Maxim D.
