Description
The nginx connection hangs until timeout for the following nginx configuration:
header_filter_type 'java';
header_filter_name 'MyHeaderFilter'
proxy_http_version 1.1;
proxy_buffering off;
Note the curl output in verbose mode shows:
Transfer-Encoding: chunked
It works fine if I remove the header filter.
It also works fine if I make any of the following changes:
- change proxy_buffering to on
- change proxy_http_version to 1.0
- set Content-Length in response header
Note if I change proxy_http_version to 1.0 or set Content-Length in response header, the transfer encoding is no longer trunked. I am not sure this is related to the hanging issue. Even with trunked transfer encoding, it works fine if I change proxy_buffering to on.
For testing purpose, my filter class is simply:
public class MyFilter implements NginxJavaHeaderFilter {
@OverRide
public Object[] doFilter(int status, Map<String, Object> request, Map<String, Object> responseHeaders) throws IOException {
return Constants.PHASE_DONE;
}
}
My nginx version is 1.12.2 and my nginx-closure version is 0.4.5. You should be able to reproduce the issue easily.
This is a blocking issue for me as my customers use the above configuration for streaming large amount of data. Thanks for your help!
Jason