﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
467	Transfer-Encoding: chunked и proxy_pass	Александр Гурьянов		"Добрый день у меня есть приложение на java которое использует в качестве сервера Netty. Это приложение возвращает простой ответ в режиме Transfer-Encoding: chunked. Все прекрасно работает если я использую это приложение напрямую. Когда я ставлю перед ним nginx, то ответ nginx всегда пустой. Настройки nginx у меня такие (http://serverfault.com/questions/159313/enabling-nginx-chunked-transfer-encoding/187573#187573):

location / {
  chunked_transfer_encoding on;
  proxy_buffering off;
  proxy_pass http://127.0.0.1:8000;
}

Тест сервера напрямую:
{{{
 curl -v ""127.0.0.1:8000""
* About to connect() to 127.0.0.1 port 8000 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8000
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
< Cache-Control: no-store, no-cache, must-revalidate, max-age=0
< Connection: keep-alive
< Transfer-Encoding: chunked
<
123
* Connection #0 to host 127.0.0.1 left intact
}}}
Тест через nginx:
{{{
curl -v ""127.0.0.1""
* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.2.6 (Ubuntu)
< Date: Mon, 09 Dec 2013 09:54:01 GMT
< Content-Type: text/plain; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-store, no-cache, must-revalidate, max-age=0
<
* Connection #0 to host 127.0.0.1 left intact
}}}
Я прогнал все через wireshark, но там тоже информации не много.

TCP stream напрямую:
{{{
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: 127.0.0.1
Accept: */*
 
HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Connection: keep-alive
Transfer-Encoding: chunked
 
1
1
1
2
1
3
1

 
0 
}}}
TCP stream через nginx:
{{{
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: 127.0.0.1
Accept: */*
 
HTTP/1.1 200 OK
Server: nginx/1.2.6 (Ubuntu)
Date: Mon, 09 Dec 2013 10:17:58 GMT
Content-Type: text/plain; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
 
0 
}}}

Архив с приложением https://mega.co.nz/#!KZUR0BqZ!XT7RGXiCcYNkfzGB2cYinlSydZNeSg6UOsFLxpsHcYU

Запускать так:
./script/runner quickstart.Boot"	defect	closed	major		nginx-core		invalid			Linux green 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.4.1
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt=-Wno-error --user=wwwrun --with-http_addition_module --with-http_stub_status_module --with-http_stub_status_module --with-http_stub_status_module --with-http_realip_module"
