Nginx answers too large requests with bad status

Francis Daly francis at daoine.org
Tue Oct 30 20:10:08 UTC 2012


On Tue, Oct 30, 2012 at 10:08:38AM -0400, B.R. wrote:

Hi there,

> Alright, I got it now.
> That's because the protocol defines its version after the request
> address... which is already too long to be fully read.

Correct. Your script thought it made a HTTP/1.1 request, and expected
a HTTP/1.1 response.

nginx thought your script made a HTTP/0.9 request, and provided a
HTTP/0.9 response.

When something expects a HTTP/1.1 response and gets a HTTP/0.9 response,
bad things can happen unless it was written defensively.

> Thanks for your help!
> No bug in Nginx indeed :o)

I'd say not a bug, but an inconvenience.

I imagine that the cost to the HTTP/0.9 clients of seeing an extra

"""
HTTP/1.0 414 No

"""

at the start of this response is less than the cost to the HTTP/1.x
clients of not seeing those two lines.

But until someone who cares does the work, the cost to nginx of changing
the current behaviour is unknown, but certainly non-zero.

> I'll go set up better buffers,

Yes. The buffers should be set to include all requests that you wish
to accept. If your system uses particularly big requests, then you
need big buffers.

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list