Apache reverse proxy of bokeh server not serving interactive content
<p>I have the interactive slider example, sliders.py, running locally on my server with no issues. However, when I try to use Apache 2.4.7 to set up a reverse proxy between <code>bokeh.example.blah</code> and <code>http://127.0.0.1:5006/sliders</code>, the page on a remote computer loads without the interactive element, although HTML elements like the page title do load.</p>

<p>I run sliders.py with this command
<code>bokeh serve sliders.py --host bokeh.example.blah</code>
A tornado 404 warning pops up when I try to access <code>bokeh.example.blah</code>:</p>

<pre><code>    INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006 with applications at paths ['/sliders']
    DEBUG:bokeh.server.tornado:[pid 7611] 0 clients connected
    DEBUG:bokeh.server.tornado:[pid 7611]   /sliders has 0 sessions with 0 unused
    INFO:tornado.access:200 GET /sliders (127.0.0.1) 43.49ms
    WARNING:tornado.access:404 GET /slidersstatic/css/bokeh.min.css?v=25ce17349a0082e9eeac845e42a822ec (127.0.0.1) 0.84ms
    WARNING:tornado.access:404 GET /slidersstatic/css/bokeh-widgets.min.css?v=3b73ec63df304369ffc9c7e5132463cd (127.0.0.1) 0.78ms
    WARNING:tornado.access:404 GET /slidersstatic/js/bokeh.min.js?v=50ffae624cbe67773b5995270f946406 (127.0.0.1) 0.69ms
    WARNING:tornado.access:404 GET /slidersstatic/js/bokeh-widgets.min.js?v=7cfd458197bc395bb09e9dc3b8ac7975 (127.0.0.1) 0.71ms
    WARNING:tornado.access:404 GET /slidersstatic/js/bokeh-compiler.min.js?v=28af56ac5027aa8d0ab96086ec1da10b (127.0.0.1) 0.74ms
</code></pre>

<p>I this is my <code>000-default.conf</code></p>

<pre><code>    &lt;VirtualHost *:80&gt;
        ProxyHTMLEnable On

        ProxyPreserveHost On
        ServerName bokeh.example.blah
        ProxyPass / http://127.0.0.1:5006/sliders
        ProxyPassReverse / http://127.0.0.1:5006/sliders

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    &lt;/VirtualHost&gt;
</code></pre>

<p>Interestingly, no apache error log is created when this happens.</p>

<p>Googling tells me that serving dynamic content with apache through a reverse proxy is sometimes problematic- this led me to add the 'ProxyHTMLEnable On' to my .conf file. If anyone has seen this sort of issue before and has advice it would be much appreciated!</p>

<p>I also notice that there seem to be a few places that indicate that documnetation about how to deploy bokeh apps is pending. For instance, the empty Deploying for Production section <a href="http://bokeh.pydata.org/en/0.10.0/docs/user_guide/server.html#deploying-for-production" rel="nofollow">here</a>, or this <a href="https://github.com/bokeh/bokeh/issues/3164" rel="nofollow">issue</a>. Does information about this already exist and I'm just looking in the wrong place?</p>

<p>Thanks!</p>

<h2>Update:</h2>

<p>I now have a different error.</p>

<p>The previous error was due to the fact that I hadn't specified where bokeh keeps its static files. I did so by modifying '000-default.conf' to this:</p>

<pre><code>    &lt;VirtualHost *:80&gt;    
        ServerName bokeh.example.blah                                                                                     

        ProxyPreserveHost On
        ProxyPass /sliders/ws ws://127.0.0.1:5100/sliders/ws
        ProxyPassReverse /sliders/ws ws://127.0.0.1:5100/sliders/ws

        ProxyPass /sliders http://127.0.0.1:5100/sliders/
        ProxyPassReverse /sliders http://127.0.0.1:5100/sliders/

        &lt;Directory /&gt;
            Require all granted
            Options -Indexes
        &lt;/Directory&gt;

        Alias /static /usr/local/lib/python2.7/dist-packages/bokeh/server/static
        &lt;Directory /usr/local/lib/python2.7/dist-packages/bokeh/server/static&gt;
            # directives to effect the static directory                         
            Options +Indexes
        &lt;/Directory&gt;
    &lt;/VirtualHost&gt;
</code></pre>

<p>As before, I can load only the title of the HTML page, but not the interactive plot. Now, the java console gives me this error:</p>

<pre><code>    WebSocket connection to 'ws://bokeh.example.blah/sliders/ws?bokeh-protocol-version=1.0&amp;bokeh-session-id=pyrxrMepBAnQyAdl4UpACinDdhxcegz0SWtNnonrLngM' failed: Error during WebSocket handshake: Unexpected response code: 500
    bokeh.min.js?v=50ffae6…:62 Bokeh: Failed to connect to Bokeh server Error: Could not open websocket
</code></pre>

<p>I would really appreciate advice!</p>