﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1292	Chunked FastCGI output gets chunked an extra time	jmarshall.com@…		"When my FastCGI script returns a chunked body, with ""Transfer-Encoding: chunked"", nginx applies an extra layer of chunking to it.  In other words, it takes the entire chunked output and wraps *that* in a single large chunk.  For example, the first (FastCGI) response below results in the second (nginx) response:

================================
Status: 200 OK
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: close

5
hello
6
_world
0

================================
HTTP/1.1 200 OK
Server: nginx/1.13.1
Date: Mon, 12 Jun 2017 02:13:57 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: close

14
5
hello
6
_world
0


0

================================

I'm attaching a short Perl FastCGI script that demonstrates this bug.  Here's the block for it in nginx.conf:

location /test/ {
    fastcgi_pass        127.0.0.1:8003;
}


I've looked through old bugs, and this bug is alluded to several times, but those tickets have been closed.  However, I just upgraded nginx from 1.4.7 to 1.31.1 and the problem happens in both.

Marking this as ""major"" since chunked encoding is critical for serving long script output in reasonable time, and this bug essentially prevents chunked encoding from being used.

"	defect	closed	major		nginx-core	1.13.x	invalid	FastCGI, chunked, double		Linux linux-9pu7 3.12.67-64-desktop #1 SMP PREEMPT Fri Dec 9 15:56:17 UTC 2016 (35c7b99) x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.13.1
built by gcc 4.8.1 20130909 [gcc-4_8-branch revision 202388] (SUSE Linux) 
built with OpenSSL 1.0.1k 8 Jan 2015
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --with-http_ssl_module --sbin-path=/usr/sbin/nginx
"
