How to make a chunked request via nginx How to make a chunked request via nginx nginx nginx

How to make a chunked request via nginx


I have gathered up answers to all parts of this question.

Base nginx does not support chunked requests (as Alexander confirmed!). Nginx can support chunked request by using NginXHttpCunkinModule (as my question mentions). Better: this module graduated from beta status to production quality more than 18 months ago. Best: I spoke with some members of the CloudFoundry engineering team at a recent meetup; they confirm that it's planned to add this module to their version of nginx. Problem solved. (Well, it's fully solved in the long term. But we don't have an exact date for when to expect this.)

Therefore a short-term solution would be nice as well. I found one.

Answering my question directed to Alexander: It's not possible to send "Content-Length" with chunked messages. That's really the point of chunked messages: you start sending them before you have the full content, so you cannot possibly know the length yet. So his idea to avoid chunked requests is correct. But to be more practical I would say, "Use HTTP/1.0 rather than HTTP/1.1." This has the effect of not sending chunked messages. We were able to patch our client temporarily to test this idea out. It worked. But we do not plan to roll out a public patch. It seems counterproductive to make everyone use a ten year old protocol (and a 10 year old unsupported client library!) to solve the problem for this one situation.

Instead I'll use the hacked client when needed, I'll email out if others find a need for it, and we'll wait for CloudFoundry up update to HttpChunkin and HTTP/1.1.


Nginx does not support chunked requests indeed. It would return 411 Content Length required in absence of Content-Length header.

Since you are controlling your client code, I guess the only choice is to avoid using chunked requests and to specify Content-Length explicitly.