I would love some inputs on the attempted configuration for load balancing websocket & http requests in conjunction with ProxyPassMatch.
I am trying to load balance via Apache 2.4.25 two instances of an application which intrinsically uses nginx as its internal proxy. It seems straightforward to use Apache as a reverse proxy for a single instance with the IP address 10.x.x.x, the traffic capture suggests that the websocket upgrade from http is successful.
ProxyPassMatch "^/(.*\websocket)$" "ws://10.x.x.x:80/$1"
However, as soon as i attempt to utilize the balancer module for websockets in conjunction with ProxyPassMatch, the websocket handshake is not successful and the traffic capture from the browser debug suggests a 400 error for bad request.
In my opinion that's odd since the request header seems identical and so does the requested url for the earlier successful websocket upgrade.
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
ProxyPass / balancer://balservers/ stickysession=ROUTEID nofailover=Off
ProxyPassReverse / balancer://balservers
ProxyPassMatch "^/(.*\websocket)$" "balancer://wsbalservers/"
<Proxy balancer://balservers>
ProxySet lbmethod=byrequests
ProxySet stickysession=ROUTEID
</Proxy>
<Proxy balancer://wsbalservers>
BalancerMember "ws://10.x.x.x:80/$1" loadfactor=50 route=node1 ttl=1200 >smax=5
BalancerMember "ws://10.y.y.y:80/$1" loadfactor=50 route=node2 ttl=1200 >smax=5
ProxySet stickysession=ROUTEID
</Proxy>
I did try commenting node2 in both balancer configurations to rule out any session stickiness issues although that did not help or change anything.
For the record, is the proxypassmatch and balancer combination not feasible ? It does pass the syntax check so I assume its ok.