Debug Http 400 Errors

I’m getting some 400 errors in my logs, and I’m wondering if there is a
log
variable which will tell me the attempted url that was trying to be
accessed. I have tried both $request and $request_uri, but both look
like
they give the path to the file trying to be accessed, and are blank when
the
error code is 400.

Here is my logging definition:

log_format response_times '$request_time $remote_addr [$time_local]
$request_uri $status ';

Couple samples:

0.000 64.231.103.198 [10/Jun/2008:08:24:36 -0500] /static/file.swf 304
13.775 99.229.230.29 [10/Jun/2008:08:24:37 -0500] /static/file.swf 200
0.000 194.144.8.59 [10/Jun/2008:08:24:38 -0500] - 400

I’ve debugged this a little further and found the following info
messages
from the clients getting a 400:

2008/06/10 10:31:32 [info] 8788#0: *29524 client closed prematurely
connection while reading client request line, client: 77.40.197.215,
server:
_
2008/06/10 10:31:33 [info] 8788#0: *29776 recv() failed (104: Connection
reset by peer) while reading client request line, client: 60.51.123.123,
server: _
2008/06/10 10:31:33 [info] 8788#0: *29556 client closed prematurely
connection while reading client request line, client: 77.40.197.215,
server:
_

Anyone?

On Tue, 10 Jun 2008 09:25:07 -0400
“Davy C.” [email protected] wrote:

I’m getting some 400 errors in my logs, and I’m wondering if there is
a log variable which will tell me the attempted url that was trying
to be accessed. I have tried both $request and $request_uri, but
both look like they give the path to the file trying to be accessed,
and are blank when the error code is 400.
[…]
0.000 194.144.8.59 [10/Jun/2008:08:24:38 -0500] - 400

This is what you see when the client closed the connection before their
request was actually sent. So you can’t get the attempted url in the
log; the server never received a url from the client.