After closer look, seems you have a lot of such messages:
2024/03/26 12:05:11 [warn] 348#348: *937022 a client request body is buffered to a temporary file /tmp/nginx/client-body/0000012134, client: **.**.112.184, server: preprod.metrics-api.***.com, request: "POST /data?request_id=2488970314211455&origin=script_tph_unbiased&start_time=2024-03-26T12%3A03%3A00.000Z&end_time=2024-03-26T12%3A04%3A00.000Z HTTP/1.1", host: "preprod.metrics-api.***.com"
Seems for some, your app returns HTTP 502:
**.**.112.184 - - [26/Mar/2024:09:01:02 +0000] "POST /data?request_id=9884629743835268&origin=script_tph_unbiased&start_time=2024-03-26T08%3A59%3A00.000Z&end_time=2024-03-26T09%3A00%3A00.000Z HTTP/1.1" 502 150 "-" "python-requests/2.31.0" 3378778 0.474 [zd0575a39-z3c23caad-app-z629366c1-metrics-api-5000] [] **.**.18.128:5000 0 0.355 502 a1641812231d350e723bf2f52d61616f
**.**.112.184 - - [26/Mar/2024:09:21:04 +0000] "POST /data?request_id=5212105373695189&origin=script_tph_unbiased&start_time=2024-03-26T09%3A17%3A00.000Z&end_time=2024-03-26T09%3A19%3A00.000Z HTTP/1.1" 502 150 "-" "python-requests/2.31.0" 3420321 0.393 [zd0575a39-z3c23caad-app-z629366c1-metrics-api-5000] [] **.**.18.128:5000 0 0.276 502 fcccb0caf1f21406824e8a27031869d5
**.**.112.184 - - [26/Mar/2024:10:18:15 +0000] "POST /data?request_id=666537369708680&origin=script_rain_detection&start_time=2024-03-26T10%3A13%3A00.000Z&end_time=2024-03-26T10%3A18%3A00.000Z HTTP/1.1" 502 150 "-" "python-requests/2.31.0" 283615 0.373 [zd0575a39-z3c23caad-app-z629366c1-metrics-api-5000] [] **.**.18.128:5000 0 0.350 502 c0650e98ab3a61b2c591292311b6a1ab
You also have things like
2024/03/26 10:18:15 [error] 164#164: *108859 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: **.**.112.184, server: preprod.metrics-api.*.*.com, request: "POST /data?request_id=666537369708680&origin=script_rain_detection&start_time=2024-03-26T10%3A13%3A00.000Z&end_time=2024-03-26T10%3A18%3A00.000Z HTTP/1.1", upstream: "http://100.64.18.128:5000/data?request_id=666537369708680&origin=script_rain_detection&start_time=2024-03-26T10%3A13%3A00.000Z&end_time=2024-03-26T10%3A18%3A00.000Z", host: "preprod.metrics-api.*.*.com"
2024/03/26 10:23:12 [error] 164#164: *114073 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: **.**.112.184, server: preprod.metrics-api.*.*.com, request: "GET /data?request_id=9166882577039716&origin=script_rain_detection&fields=real_length&start_time=2024-03-25T10%3A23%3A00.000Z&end_time=2024-03-26T00%3A16%3A00.000Z&stations_codes=GEO-00009&stations_codes=GEO-00017&stations_codes=GEO-00020&stations_codes=GEO-00024&stations_codes=GEO-00025&stations_codes=GEO-00026&stations_codes=GEO-00029&stations_codes=GEO-00003&stations_codes=GEO-00006&stations_codes=GEO-00010&stations_codes=GEO-00013&stations_codes=GEO-00014&stations_codes=GEO-00015&stations_codes=GEO-00001&stations_codes=GEO-00002&stations_codes=GEO-00004&stations_codes=GEO-00005&stations_codes=GEO-00008&stations_codes=GEO-00011&stations_codes=GEO-00021&stations_codes=GEO-00022&stations_codes=GEO-00023&stations_codes=GEO-00027&stations_codes=GEO-00028&stations_codes=GEO-00012&sciences_environment=preproduction&format=wide_array&metrics_type=raw HTTP/1.1", upstream: "http://100.64.18.128:5000/data?request_id=9166882577039716&origin=script_rain_detection&fields=real_length&start_time=2024-03-25T10%3A23%3A00.000Z&end_time=2024-03-26T00%3A16%3A00.000Z&stations_codes=GEO-00009&stations_codes=GEO-00017&stations_codes=GEO-00020&stations_codes=GEO-00024&stations_codes=GEO-00025&stations_codes=GEO-00026&stations_codes=GEO-00029&stations_codes=GEO-00003&stations_codes=GEO-00006&stations_codes=GEO-00010&stations_codes=GEO-00013&stations_codes=GEO-00014&stations_codes=GEO-00015&stations_codes=GEO-00001&stations_codes=GEO-00002&stations_codes=GEO-00004&stations_codes=GEO-00005&stations_codes=GEO-00008&stations_codes=GEO-00011&stations_codes=GEO-00021&stations_codes=GEO-00022&stations_codes=GEO-00023&stations_codes=GEO-00027&stations_codes=GEO-00028&stations_codes=GEO-00012&sciences_environment=preproduction&format=wide_array&metrics_type=raw", host: "preprod.metrics-api.*.*"
2024/03/26 11:23:00 [error] 554#554: *177068 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: **.**.112.184, server: preprod.metrics-api.*.*.com, request: "GET /data?request_id=1440249459496182&origin=script_raster_th&fields=humidity_unbiased&start_time=2024-03-26T11%3A15%3A00.000Z&end_time=2024-03-26T11%3A19%3A00.000Z&stations_codes=GEO-00001&stations_codes=GEO-00005&stations_codes=GEO-00008&stations_codes=GEO-00012&stations_codes=GEO-00014&stations_codes=GEO-00015&stations_codes=GEO-00017&stations_codes=GEO-00021&stations_codes=GEO-00023&stations_codes=GEO-00024&stations_codes=GEO-00025&stations_codes=GEO-00026&stations_codes=GEO-00028&stations_codes=GEO-00029&sciences_environment=preproduction&format=wide_array&metrics_type=raw HTTP/1.1", upstream: "http://**.**.20.235:5000/data?request_id=1440249459496182&origin=script_raster_th&fields=humidity_unbiased&start_time=2024-03-26T11%3A15%3A00.000Z&end_time=2024-03-26T11%3A19%3A00.000Z&stations_codes=GEO-00001&stations_codes=GEO-00005&stations_codes=GEO-00008&stations_codes=GEO-00012&stations_codes=GEO-00014&stations_codes=GEO-00015&stations_codes=GEO-00017&stations_codes=GEO-00021&stations_codes=GEO-00023&stations_codes=GEO-00024&stations_codes=GEO-00025&stations_codes=GEO-00026&stations_codes=GEO-00028&stations_codes=GEO-00029&sciences_environment=preproduction&format=wide_array&metrics_type=raw", host: "preprod.metrics-api.*.*.com"
Those are more complicated to diagnose, might be nginx cutting responses because response headers are too big, or maybe your app is cutting it.
Can you disable those two settings (cutting off buffering), we should see clearer.
Last, for recv() failed
can you provide a request generating such error? You can try to send it via a port forward directly to your app to see what happens (pulling out nginx).
Cheers