nginxkuberneteskong-ingress

kong HTTP/2 stream 1 was not closed cleanly before end of the underlying stream


We are using kong v2.2 as ingress controller,

some of our requests got an error: HTTP/2 stream 1 was not closed cleanly before end of the underlying stream

And they are not passed from kong to our backend servers.


Solution

  • After an investigation of the nginx http2 directive: http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_field_size https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_header_size

    We can see that both directives has a small default value: The default value for http2_max_field_size is 4k, and for http2_max_header_size is 16k.

    We increased them both using the following environment variables(kong configmap):

    KONG_NGINX_HTTP_HTTP2_MAX_FIELD_SIZE: 16k KONG_NGINX_HTTP_HTTP2_MAX_HEADER_SIZE: 64k