Search…
2.4.1 Apache httpd配置
1
Header add Set-Cookie "SERVERID=sticky.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
2
3
<Proxy "balancer://nodes_polling">
4
BalancerMember "http://app01:3000" route=app01
5
BalancerMember "http://app02:3000" route=app02
6
BalancerMember "http://app03:3000" route=app03
7
ProxySet stickysession=SERVERID
8
</Proxy>
9
10
<Proxy "balancer://nodes_ws">
11
BalancerMember "ws://app01:3000" route=app01
12
BalancerMember "ws://app02:3000" route=app02
13
BalancerMember "ws://app03:3000" route=app03
14
ProxySet stickysession=SERVERID
15
</Proxy>
16
17
RewriteEngine On
18
RewriteCond %{HTTP:Upgrade} =websocket [NC]
19
RewriteRule /(.*) balancer://nodes_ws/$1 [P,L]
20
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
21
RewriteRule /(.*) balancer://nodes_polling/$1 [P,L]
22
23
ProxyTimeout 3
Copied!
例子
Last modified 2yr ago
Copy link