title: Could not open websocket with bokeh on nginx
body: <p>I am trying to use <a href="https://bokeh.org/" rel="nofollow noreferrer">bokeh</a> on a digitalocean droplet, which runs ubuntu 18.04 with LAMP stack and reverse-proxy nginx (set up as described in these tutorials <a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04" rel="nofollow noreferrer">Initial server setup</a>, <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04" rel="nofollow noreferrer">LAMP setup</a>, <a href="https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-18-04-server" rel="nofollow noreferrer">nginx as reverse-proxy</a> ). </p>
  
  <p>I used these tutorials (<a href="https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04" rel="nofollow noreferrer">1</a> and <a href="https://rbtechblog.com/blog/deploy_bokeh_app" rel="nofollow noreferrer">2</a>) for setting up the bokeh part.</p>
  
  <p>It looks like that it almost works but I get some error messages in the Browser console, of which I do not know how to resolve them.</p>
  
  <p>This is the output in the browser console:</p>
  
  <pre><code>Bokeh: BokehJS not loaded, scheduling load and callback at Date ...
  Bokeh: injecting script tag for BokehJS library:  /bokeh/static/js/bokeh.min.js?v=547e7d2591695b654def5914eef697fa 
  Bokeh: injecting script tag for BokehJS library:  /bokeh/static/js/bokeh-widgets.min.js?v=423bf6bb32b8def9b7c9df74817506e4 
  Bokeh: injecting script tag for BokehJS library:  /bokeh/static/js/bokeh-tables.min.js?v=5f778b8a005d8538b5b14598ec45fc16 
  Bokeh: injecting script tag for BokehJS library:  /bokeh/static/js/bokeh-gl.min.js?v=be19384f76795da42f52380e7b5fd473 
  Bokeh: all BokehJS libraries/stylesheets loaded 
  Bokeh: BokehJS plotting callback run at Date ...
  [bokeh] setting log level to: 'info' 
  Bokeh: all callbacks have finished 
  Source map error: request failed with status 404
  Resource URL: https://my-domain.com/bokeh/static/js/bokeh.min.js?v=547e7d2591695b654def5914eef697fa
  Source Map URL: bokeh.min.js.map 2
  Source map error: request failed with status 404
  Resource URL: https://my-domain.com/bokeh/static/js/bokeh-widgets.min.js?v=423bf6bb32b8def9b7c9df74817506e4
  Source Map URL: bokeh-widgets.min.js.map
  Source map error: request failed with status 404
  Resource URL: https://my-domain.com/bokeh/static/js/bokeh-tables.min.js?v=5f778b8a005d8538b5b14598ec45fc16
  Source Map URL: bokeh-tables.min.js.map
  Source map error: request failed with status 404
  Resource URL: https://my-domain.com/bokeh/static/js/bokeh-gl.min.js?v=be19384f76795da42f52380e7b5fd473
  Source Map URL: bokeh-gl.min.js.map
  Firefox can’t establish a connection to the server at wss://my-domain.com/bokeh/ws?bokeh-protocol-version=1.0&amp;bokeh-session-id=Zts1wLAtCSZoHUr7Nx3UfIFdUAgGOMFdFA8JfEuDmEzM. 
  [bokeh] Failed to connect to Bokeh server Error: Could not open websocket 
      pull_session https://my-domain.com/bokeh/static/js/bokeh.min.js?v=547e7d2591695b654def5914eef697fa:31
  [bokeh] Lost websocket 0 connection, 1006 () 
  Error: Could not open websocket 
  [bokeh] Websocket connection 0 disconnected, will not attempt to reconnect 
  </code></pre>
  
  <p>This is part of the nginx conf file:</p>
  
  <pre><code>    location / {
          include proxy_params;
          proxy_pass http://unix:/home/user/myproject/myproject.sock;
      }
  
      # reverse proxy to embedded bokeh apps
      location /bokeh/ {
          proxy_pass http://127.0.0.1:5100;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
          proxy_http_version 1.1;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $host:$server_port;
          proxy_buffering off;
      }
  
  </code></pre>
  
  <p>I guess there is something missing in the conf file, but I cannot figure out what.</p>