In Apache 2.4 you can reverse proxy an HTTP connection to a local Unix socket with: [1]

ProxyPass unix:/path/to/app.sock|http://example.com/app/name

You can reverse proxy a WebSocket connection to a local TCP socket with: [2]

ProxyPass ws://

But how can you reverse proxy a WebSocket connection to a Unix socket? [☹]


1 Answer 1


Ok I got it, once you have mod_proxy and mod_proxy_wstunnel enabled you can do this:

ProxyPass /ws/ unix:/path/to/app.sock|ws://example.com/ws/

It works well for me since I only expect to establish a ws connection on the /ws endpoint.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.