NGINX closes long-lived HTTP/2 streams as your 4:30-5:10 minute failure window is slightly above the default 3-minute [http2\_idle\_timeout](https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_idle_timeout). This directive is also obsolete since version 1.19.7, so ensure you are using [keepalive\_timeout](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout) directive instead. Try increasing the values set for your `proxy\_read\_timeout`, `proxy\_send\_timeout,` and `keepalive\_timeout` to keep your HTTP/2 connections alive and idle longer.
Forcing curl to use HTTP/1.1 works because HTTP/1.1 handles long-lived streaming connections better in NGINX, than HTTP/2. So another workaround you can try is disabling HTTP/2 proxying upstream, and use HTTP/1.1 instead, while keeping HTTP/2 only at the client side. See related post.