Headers aren’t sent if nginx assumes the request is in HTTP/0.9
format. The above script makes nginx to think it’s HTTP/0.9 as
uri used dosn’t fit into header buffer and nginx isn’t able to
see “HTTP/1.1” before it returns 414.
responses. I have a simple test-script in bash which you can run to
Headers aren’t sent if nginx assumes the request is in HTTP/0.9
format. The above script makes nginx to think it’s HTTP/0.9 as
uri used dosn’t fit into header buffer and nginx isn’t able to
see “HTTP/1.1” before it returns 414.
If nginx assumes HTTP/0.9 for the request, it doesn’t seem very logical
to return an error which cannot exist within that very protocol?
Well, it does not return error. It just returns a page with text:
“414 Request-URI Too Large”. What can you suggest to return for
a request larger than configured buffer ?
of the RFC is that this is unwanted, see
the maximum request-length in HTTP/0.9, but I cannot find any. I found
a request larger than configured buffer ?
When I said it returns an error I obviously meant it returns a HTTP
error. Since HTTP/0.9 doesn’t define a maximum length for a URL, it
seems strange to return an error about this very length in this specific
protocol.
I think the only problem I have with this behavior is nginx falling back
to HTTP/0.9; a protocol which isn’t used on any network I know. I would
prefer falling back to HTTP/1.0 which more clients will support,
although I don’t know what impact this has.