Enabling nginx Chunked Transfer Encoding

Solution 1:

This is an old question, I know, but it came up in a search for the problem (which I've spent the afternoon trying to solve). Martin F's comment gave me enough of a clue to get it working!

The trick is to set proxy_buffering off; in your location block. Assuming that your upstream server is sending back chunked responses, this will cause nginx to send the individual chunks back to the client - even gzipping them on the fly if you have gzip output compression turned on.

Note that turning off buffering may have other disadvantages, so don't go blindly turning off buffering without understanding why.

Solution 2:

I suggest editing your question to clarify. There is a big difference between chunked requests and chunked responses. John Dalton's answer addresses the latter. Git does both.

Nginx does not currently support chunked POST requests and this posting shows up high in search results on the topic. Chunked POST requests are used when you do not know the amount of data being uploaded in advance and is frequently used by mobile phones.

The only working solution I found is this:

http://wiki.nginx.org/HttpChunkinModule

Unfortunately it requires recompiling nginx as nginx doesn't support loadable modules.

Solution 3:

On my case... i try a lot of things and finally only need add to configuration

proxy_http_version 1.1;

And it works...