We have a setup that looks like this:
Client -> AWS ELB (tcp load balancing)-> NGINX (ssl termination) -> application server.
We want to gracefully take application servers out of the load balancer. We do this by having a health check that responds with 503 when the node is about to shut down, while allowing any pending requests to complete.
However, since nginx is configured to use keep-alive, clients that have already established a connection may continue to send new requests, even after the node has been taken out of the load balancer.
Connection: close header in all responses from the application server does not help, as nginx (rightfully, according to the RFC) does not pass that on to the client.
Is there any other way, but to disable keep-alive altogether?