title: Nginx backend shutdown without losing sessions
body: <p>So I'm having reverse proxy server, where Nginx working as proxy server and loadbalancer. My biggest problem, that I have 2 app backends, which I need sometimes to shutdown. When I write after server <strong><em>down</em></strong> the backend, shutdown and looses sessions. How can I gracefully shutdown one of my app server? So that Nginx wait while all sessions will be completed or for some time?</p>
  
  <p>My simple config:</p>
  
  <pre><code>upstream loadbalancer {
                  ip_hash;
                  server          192.168.0.1:443;
                  server          192.168.0.2:443;
  }
  </code></pre>