Proxy_pass of PUT with no Content_length header returns 411

I am having trouble with proxy_pass and PUT without a Content-Length
header
returning a 411 error.

curl -XPUT http://localhost:8080/

411 Length Required

411 Length Required


nginx/1.1.19 # touch temp # curl -X PUT http://localhost:8080/ -T temp {"response": "ok"} #

Relevant configuration:

Proxy to Backend Server

server {
listen localhost:8080;

location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend_server;
}
}

I found this post which seems to be the same problem:
http://forum.nginx.org/read.php?2,72279,72279#msg-72279

Is there a way to get nginx to proxy PUT requests WITHOUT a
Content-Length
header?
Does a newer version of nginx NOT suffer from this limitation?

Thanks,
~ Nick

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,237607,237607#msg-237607

Hello!

On Wed, Mar 20, 2013 at 06:09:26PM -0400, nickpalmer wrote:

http://forum.nginx.org/read.php?2,72279,72279#msg-72279

Is there a way to get nginx to proxy PUT requests WITHOUT a Content-Length
header?
Does a newer version of nginx NOT suffer from this limitation?

PUT requests without a Content-Length header (either using chunked
transfer encoding, or without a request body at all) are allowed
in nginx 1.3.9+.


Maxim D.
http://nginx.org/en/donation.html

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs