Apache 2.4.25: Attempting to load balance websockets in conjunction with ProxyPassMatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


ProxyPass / "http://10.x.x.x/
ProxyPassReverse / "http://10.x.x.x/"
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>
   BalancerMember  "http://10.x.x.x" loadfactor=50 route=node1 ttl=1200 smax=5
   BalancerMember  "http://10.y.y.y" loadfactor=50 route=node2 ttl=1200 smax=5
   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. 


Regards,
VM

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux