I am trying to configure apache so I can have my Phoenix-Elixir-application running on the same server as some other applications.
The basic request-passing works, but I am having problems with the websocket-connections:
<VirtualHost *:80> DocumentRoot "/var/www/my_app" ServerName my_app.tld ServerAlias www.my_app.tld LoadModule proxy_module modules/mod_proxy.so ProxyRequests Off ProxyPreserveHost On ProxyPass "/" "ws://localhost:4096/" retry=0 timeout=5 ProxyPassReverse "/" "ws://localhost:4096/" my_app.tld </VirtualHost>
However, this does not properly work. The websocket connections fail, with the following response in the browser console:
WebSocket connection to 'ws://my_app.tld/socket/websocket?vsn=2.0.0' failed: Error during WebSocket handshake: Unexpected response code: 400
I don’t know what went wrong, but also not how to debug this: Nothing can be found in the apache log, nor in the Phoenix application log.