Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting a 411 status back from nginx when trying to do a PUT without specifying the content-length. Is there any way to disable this from happening?

share|improve this question

You could try to add this to your query :

curl -i -X PUT -H 'Content-Length: 0' ''

Try to install the HttpChunkinModule or update Nginx to 1.3.9+

This module is no longer needed for Nginx 1.3.9+ because since 1.3.9, the Nginx core already has built-in support for the chunked request bodies.

share|improve this answer

PUT requests require Content-Length. It's not Nginx, it's HTTP that's making this requirement. PUT request, like POST requests, necessarily have a content body. That body can be zero-length, but if it is then you have to explicitly say so. Obviously you can't assume that the content continues until the connection is closed (which is what an absent content-length header implies), because the server has to be able to respond to the request before the connection is closed.

share|improve this answer
this is incorrect. "The presence of a message-body in a request is signaled by the inclusion of a Content-Length or Transfer-Encoding header field in the request's message-headers." This is a bug in nginx that is fixed in more recent versions. Note that this bug was fixed for POST long before PUT. – Nick Palmer Mar 28 '13 at 2:51

Old-ish question, but since I stumbled into this from a web search:

NginX 1.3.9 and above supports "Transfer-Encoding: chunked" out of the box for POST and PUT.

With chunked transfer, you can send files without setting content-length first.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.