My Setup already works over TCP with these two lines in my virtualhost:
ProxyPassMatch ^/ws/.*$ ws://localhost:8000/
ProxyPass / http://localhost:8000/
Now I want to use unix sockets. So I prepended unix:$SOCKETPATH|
and removed the port:
ProxyPassMatch ^/ws/.*$ unix:/run/myapp.sock|ws://localhost/
ProxyPass / unix:/run/myapp.sock|http://localhost/
It works for HTTP, but websocket connections fail. I tried variations of the right side in the websockets line, e.g.:
ProxyPassMatch ^/ws/.*$ unix:/run/myapp.sock|ws:///
ProxyPassMatch ^/ws/.*$ unix:/run/myapp.sock|ws://
Besides getting it to work, I'd like to understand why there is the part after the pipe (|) needed anyways? After all, Apache should only need to know the unix socket path, shouldn't it? The Apache documentation on ProxyPass does not explain this.
These similar questions did not help:
I upgraded the Debian Apache packets from 2.4.38-3+deb10u4 (stable) to 2.4.46-4~bpo10+1 (backports) and now it works. The Apache changelog mentions multiple changes to websockets. I suppose this change might have been the problem: