title: Nginx Reverse Proxy WebSocket Timeout
body: <p>I'm using java-websocket for my websocket needs, inside a wowza application, and using nginx for ssl, proxying the requests to java.</p>
  
  <p>The problem is that the connection seems to be cut after exactly 1 hour, server-side. The client-side doesn't even know that it was disconnected for quite some time. I don't want to just adjust the timeout on nginx, I want to understand why the connection is being terminated, as the socket is functioning as usual until it isn't.</p>
  
  <p>EDIT:
  Forgot to post the configuration:</p>
  
  <pre><code>location /websocket/ {
      proxy_set_header        X-Real-IP       $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      include conf.d/proxy_websocket;
      proxy_connect_timeout 1d;
      proxy_send_timeout 1d;
      proxy_read_timeout 1d;
  }
  </code></pre>
  
  <p>And that included config:</p>
  
  <pre><code>proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
  proxy_pass                      http://127.0.0.1:1938/;
  </code></pre>
  
  <ul>
  <li>Nginx/1.12.2</li>
  <li>CentOS Linux release 7.5.1804 (Core)</li>
  <li>Java WebSocket 1.3.8 (<a href="https://github.com/TooTallNate/Java-WebSocket" rel="nofollow noreferrer">GitHub</a>)</li>
  </ul>