Search code examples
nginxcurlkubernetes-ingressnginx-ingresskong

HTTP/2 stream 0 was not closed cleanly at 1028MB


I have a web server that returns a large amount of JSON (over 1GB) When I curl it directly, it works fine.

However, when I put it behind a Kubernetes ingress (Kong which is based of nginx), the connection always gets cut off at 1028M

enter image description here

Any ideas how I can approach this?


Solution

  • The problem was with this setting: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size

    Basically, slow clients caused the server to buffer response in a temporary file in nginx. Once file reached its size limit, nginx cut the connection.

    I'm still not 100% why nginx cut the connection (maybe upstream server timed out), but increasing that value solved my problem