[Troubleshooting] Node.js app on App Engine Flex / Nginx connection reset by peer while proxying upgraded connection

Job ID: 31685064

Budget: €30 – €250 EUR

We have a nodejs app using websocket that works perfectly fine in local development environment. After deploying the app to google app engine (flex environment), it works fine with a low number of requests but when the number of requests becomes important, the stream is closed and I get the following error :

```
"recv() failed (104: Connection reset by peer) while proxying upgraded connection, client: 142...212, server: , request: "GET /media HTTP/1.1", upstream: "http://..0.1:8080/media", host: "************.ew.r.appspot.com".
```

I think it's not a code problem (since it works fine in local environment). My first thought is that it is due to the reverse proxy (nginx, which is used by default with Google).
I have tried changing many parameters' values in the nginx.conf file (put worker_connections to 16384 ...) but I still get the same error.

The nginx config is given here https://stackoverflow.com/questions/69302307/recv-failed-104-connection-reset-by-peer-while-proxying-upgraded-connection