I&#39;m running nginx as a reverse proxy to do SSL and load balancing. The upstream server behind nginx needs to know when the client closes the connection.<div><br></div><div>If I turn ssl off, the connection looks like:</div>

<div><br></div><div>1. client connects to nginx</div><div>2. nginx connects to upstream</div><div>3. ...</div><div>4. client sends FIN/ACK to nginx</div><div>5. nginx sends FIN/ACK to upstream, and to client</div><div><br>

</div><div><br></div><div>With ssl on:<br><div><br></div><div><div>1. client connects to nginx</div><div>2. nginx connects to upstream</div><div>3. ...</div><div>4. client sends FIN/ACK to nginx</div><div>5. nginx waits 60 seconds</div>

</div><div>6. nginx sends FIN/ACK to upstream</div><div><br></div><div><br></div><div><br></div><div>What&#39;s going on here? Why does nginx wait for a timeout to send the FIN/ACK upstream? Why does the behaviour change when I turn ssl on?</div>

<div><br></div><div><br></div><div>Thanks,<br>Jeremy
</div></div>