HTTP 400 responses

Maxim Dounin mdounin at mdounin.ru
Mon Oct 19 14:04:37 UTC 2015


Hello!

On Mon, Oct 19, 2015 at 07:23:00AM -0400, Pauls V wrote:

> Problem: Nginx returns 400 on small amount of POST requests (1-5 per minute
> from 10k POST requests)
> Setup: Nginx in front of Tomcat
> Version: 1.8.0 (upgraded from 1.4.6 that had the same problem)
> Log format: log_format  main  $remote_addr - $remote_user [$time_local]
> $request $status $request_length $body_bytes_sent $request_time
> $http_referer $http_user_agent $http_x_forwarded_for $upstream_response_time
> $upstream_status;

[...]

> 400 257 0 59.711 - - 11.11.11.11 - -
> 22.22.22.22 - - [19/Oct/2015:10:14:35 +0000] POST /json/some.json HTTP/1.1
> 400 255 0 59.536 - - 11.11.11.11 - -
> 
> What I have checked:
> - the log shows that reqest wasn't sent to tomcat. Tested and tomcat
> processes all requests under 200ms.
> - nothing is written to error_log (tried info and warn)
> - the general answer of increasing large_client_header_buffers size doesn't
> seem valid here as $request_length is not close to max(in case someone can
> suggest a way of replicating these requests then I can test on 2nd
> environment)
> 
> 1. Why is Nginx replying with HTTP 400 in 0.019s for $request_length 430?
> 2. Why is there up to 60s $request_time? It looks like at 60s ELB kills it
> and returns 5xx to client.

Try looking into error logs, they should have reasons for 400 
responses logged.  You'll have to configure "info" logging level 
though.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list