Forum: NGINX Chunked transfer encoding problem

Posted by Piotr Bartosiewicz (Guest)
on 2012-11-14 17:43
(Received via mailing list)
Hi,

My nginx (1.2.4) config looks like this (relevant part):

server {
   listen 8888;

   location / {
     proxy_http_version 1.1;
     proxy_pass http://localhost:8080;
   }
}

Backend server handles GET requests and responds with a large body.
Response is generated and sent on the fly, so content-length is not
known at the beginning.
In normal case everything works fine.

But sometimes server catches an exception after a response headers were
sent.
I've found that there is a commonly used solution to inform a client
about incomplite response:
use Transfer-Encoding chunked and close socket without sending the last
(0 length) chunk.
Unfortunately nginx appends termination chunk even when the backend
server does not
(both nginx and backed connections are http/1.1 and use chunked 
encoding).

Is this expected behavior, bug or maybe there is some option to turn
this off?

Regards
Piotr Bartosiewicz
Posted by Maxim Dounin (Guest)
on 2012-11-14 18:07
(Received via mailing list)
Hello!

On Wed, Nov 14, 2012 at 05:42:49PM +0100, Piotr Bartosiewicz wrote:

>   }
> about incomplite response:
> use Transfer-Encoding chunked and close socket without sending the
> last (0 length) chunk.
> Unfortunately nginx appends termination chunk even when the backend
> server does not
> (both nginx and backed connections are http/1.1 and use chunked encoding).
>
> Is this expected behavior, bug or maybe there is some option to turn
> this off?

This is sort of known bug.  Fixing it would require relatively
large cleanup of upstream module.

--
Maxim Dounin
http://nginx.com/support.html
Posted by Piotr Bartosiewicz (Guest)
on 2012-11-15 11:13
(Received via mailing list)
W dniu 14.11.2012 18:07, Maxim Dounin pisze:
>>
>>
>> Is this expected behavior, bug or maybe there is some option to turn
>> this off?
> This is sort of known bug.  Fixing it would require relatively
> large cleanup of upstream module.
>

Thanks for the answer!
Is this expected to be fixed in 1.3 version?
I've found 'Upstream code cleanup' entry in the roadmap, but no ticket
in trac for this.

--
Piotr Bartosiewicz
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.