How to ProxyPass websocket requests to node app via apache config?
<p>I have a node app built with FeathersJS running on my server, I'd like it to be behind apache, I'm trying to use the mod_proxy module in apache to accomplish this but I've run into issues. </p>

<p>This is what my apache mod_proxy section looks like:</p>

<pre><code>&lt;IfModule mod_proxy.c&gt;
    ProxyRequests off

    ProxyPass /ws/api/phone/ ws://localhost:3030
    ProxyPassReverse /ws/api/phone/ ws://localhost:3030

    ProxyPass /api/phone/ http://localhost:3030/
    ProxyPassReverse /api/phone/ http://localhost:3030/ 
&lt;/IfModule&gt;
</code></pre>

<p>I've set my client socket configuration to the following:</p>

<pre><code>var socket = io('/', { path: '/ws/api/phone/socket.io/', transports: ['websocket']});
</code></pre>

<p>When I try to open use the app, I get the following error:</p>

<pre><code>WebSocket connection to 'ws://local.mysite.com/ws/api/phone/socket.io/?EIO=3&amp;transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 500
</code></pre>

<p>I enabled apache logging, and this is what that error looks like:</p>

<pre><code>127.0.0.1 - - [22/Oct/2016:14:48:32 -0400] "GET /ws/api/phone/socket.io/?EIO=3&amp;transport=websocket HTTP/1.1" 500 540 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
</code></pre>

<p>If I run everything via localhost, it works perfect, no issues, so this is obviously an issue with ProxyPass. Any help would be greatly appreciated, or if there's another way I could accomplish putting the node app behind apache without using ProxyPass I'd be interested to hear any other solutions.</p>

<p>Thanks in advance.</p>