Content Length and Transfer Encoding Chunked nginx, node-http-proxy
Posted
by
rampr
on Server Fault
See other posts from Server Fault
or by rampr
Published on 2012-06-06T10:26:02Z
Indexed on
2012/06/06
10:43 UTC
Read the original article
Hit count: 316
I have the following setup - node-http-proxy acts as a reverse proxy forwarding all requests to nginx/socket.io as necessary
My problem is this When I send a HTTP DELETE request from the browser, node-http-proxy adds a header "Transfer Encoding Chunked" as the request from the browser had no Content Length. The request from the browser had no Content Length as it had no body. Nginx doesn't like the Transfer Encoding Chunked Header and throws a 411 asking for Content-Length.
The problem gets solved when I send dummy data as part of the DELETE request so there is a Content Length and node-http-proxy doesn't add Transfer Encoding Chunked header and nginx is happy.
I want to understand if node-http-proxy isn't working as expected, because it adds a Transfer Encoding Chunked header when Content Length is missing because there is no Content Body.
© Server Fault or respective owner