How to Reverse Proxy Websockets with Apache 2.4 | proxypass upgrade websocket
OverviewInthistutorial,youwilllearnhowtoconfigureApacheWebServer2.4toreverseproxyWebSockets.WebSocketswereintroducedtoopentwo-wayinteractivecommunicationsessions,betweenaclientandaserver.Thispavedthewayforevent-drivenresponses,suchasnotifyingauserofnewcontentwithoutrefreshingthepage.HandlingWebSocketsinApacheWebServer2.4isn’tasstraightforwardaswithotherwebservers.PerformingasimpleGooglesearchofWebSocketproblemswithApache,wecaneasilydrawthatconclusion.Thegoalofthistutorialistoexplainhowtocorr...
OverviewIn this tutorial, you will learn how to configure Apache Web Server 2.4 to reverse proxy WebSockets.
WebSockets were introduced to open two-way interactive communication sessions, between a client and a server. This paved the way for event-driven responses, such as notifying a user of new content without refreshing the page.
Handling WebSockets in Apache Web Server 2.4 isn’t as straight forward as with other web servers. Performing a simple Google search of WebSocket problems with Apache, we can easily draw that conclusion.
The goal of this tutorial is to explain how to correctly configure Apache to reverse proxy WebSockets, using RewriteEngine and ProxyPass.
Getting StartedIn order to enable WebSocket reverse proxying, the Apache modules for handling such requests must be enabled.
proxyproxy_httpproxy_wstunnelUbuntu 16.04 / 18.04 / 19.04If you are running Ubuntu 16.04 or higher, run the following commands to enable the modules.
...