It seems that nginx does not support chunked requests well. But I'm trying to get a more definitive (and current) answer. I have a client making a SOAP request to a server from a Java client which sets the header Transfer-Encoding: chunked
. All works well when I connect directly to my application on Tomcat.
But when I put nginx between them, then things break.
To add a few details: I'm working with CloudFoundry. I'm using the Micro Cloud Foundry to confirm that things work as expected in the absence of nginx. But my requirement is to use cloudfoundry.com, so I don't have the ability to bypass nginx there.
This question and answer says that this is perhaps my only workaround: http://wiki.nginx.org/NginxHttpChunkinModule. But that workaround isn't available, since I cannot modify the configuration on cloudfoundry.com.
This question looks similar too, but it actually covers the reverse of this requirement. It covers chunked responses rather than chunked requests.
So how about any changes on the client to work around this? Is it possible to send both Transfer-Encoding: chunked
and Content-Length: 123
as headers? This area is new to me, but it seems from projects like Apache HttpComponents that one would set either the length or chunking but not both. The point of chunking is that you don't need to know the length when the request starts. Could I tell my client to use HTTP/1.0 and play nice with nginx without chunking? Are there other workaround ideas that I'm forgetting?