Forum: NGINX reverse proxy removes Transfer-Encoding: chunked

2974d09ac2541e892966b762aad84943?d=identicon&s=25 Pommi (Guest)
on 2013-09-23 20:35
(Received via mailing list)
I'm trying to setup a nginx (1.4.1) reverse proxy to a HornetQ API using
this configuration:

proxy_http_version 1.1;
proxy_set_header Host $host;
upstream app {
    keepalive 8;
server {
    server_name localhost;
    location / { deny all; }
    location = /messaging/ {
        proxy_pass http://app/messaging/;
        proxy_buffering off;

After a lot of tcpdumping I see that that nginx removes the
Transfer-Encoding header and sets the Content-Length header in place of
which the length of the first 'chunk'. After that the connection gets

When sending the following headers:

POST /messaging/ HTTP/1.1
Host: localhost
Content-Type: application/octet-stream
Transfer-Encoding: chunked
Content-Transfer-Encoding: binary

nginx will forward them like:

POST /messaging/ HTTP/1.1
Host: localhost
Content-Length: 60
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary

Is this normal behaviour?

Posted at Nginx Forum:,243073,243073#msg-243073
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2013-09-23 21:42
(Received via mailing list)

On Mon, Sep 23, 2013 at 02:34:28PM -0400, Pommi wrote:

>     listen;
> which the length of the first 'chunk'. After that the connection gets
> Is this normal behaviour?

Yes, it's expected behaviour.  Except it uses length of the full
request, not length of the first chunk.

Maxim Dounin
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.