0

I have a long poll clients that connect to nginx and upstream to kestrel dot net. Clients have keepalive set that after 2 minutes connection breaks. On nginx side i have listen 0.0.0.0:xxx ssl so_keepalive=5m:10:5; So roughly 6 minutes

I pull the eth cable out of the cable, preventing any transfers and client detects a connection break, but my upstream server does not. Upstream server never detects this.

Now is the nginx not detecting this break ? and then not closing connection to upstream ? Or what am i doing wrong?

Thank you

Lonko
  • 115
  • 5

1 Answers1

0

Your listen option specifies keepalive only for the listening socket. It does not apply to upstream connections.

To enable TCP keepalive for upstream connections, you need to add proxy_socket_keepalive on; in your nginx configuration.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • This is also true. But i found out that i was using so_keepalive=5m:10:5; incorrectly to my needs. My question also holds a clue that so_keepalive is the defacto need if you want to detect dead clients, if dead client is detected, then upstream connection is closed also. You can see dead clients in access log with 499 return code – Lonko Apr 09 '21 at 08:09