I'm connecting a client with websocket through Nginx (as a reverse proxy) to an asp.net core application. Between server and client there are heartbeat commands to keep websocket connection open.
My Problem is when a client disconnects by unplugging the network cable the connection remains open. I would like to set a timeout that when the client doesn't send anything for a certain time that the connection gets closed.
I tried multiple timeouts without any effect. (proxy_send_timeout
, client_body_timeout
, keepalive_timeout
, send_timeout
...) The only timeout I managed to set was proxy_read_timeout
. What I didn't like was that this timeout was reset every time the server send anything (and not the client).
Which timeout do I have to set to disconnect the client if the client doesn't send anything for x seconds?
Many thanks in advanced!