Nginx doesn't drop upstream connection when client disconnected

1.1k views Asked by At

In my app client connect to backend over nginx with WebSockets connection.

My nginx has next config:

        server {
                listen 80;
                listen 443 ssl;

                ssl_certificate         ...
                ssl_certificate_key     ...

                server_name ...

                proxy_socket_keepalive on;
                keepalive_timeout 10;

                location /ws {
                    proxy_pass http://localhost:10001;

                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                }
        }

Problem is, when client disconnect form Nginx backend WebSocket connection still in Open state.

How to configure Nginx to drop upstream connection when client connection disconnected?

0

There are 0 answers