|
65 | 65 | <IfModule mod_proxy_balancer.c>
|
66 | 66 |
|
67 | 67 | <Proxy "balancer://pvecluster">
|
68 |
| - BalancerMember "https://pve1:8006" |
69 |
| - BalancerMember "https://pve2:8006" loadfactor=2 |
70 |
| - BalancerMember "https://pve3:8006" loadfactor=5 |
| 68 | + BalancerMember "https://pve1:8006" route=1 keepalive=On smax=1 connectiontimeout=10 retry=600 timeout=900 ttl=900 upgrade=websocket |
| 69 | + BalancerMember "https://pve2:8006" route=2 keepalive=On smax=1 connectiontimeout=10 retry=600 timeout=900 ttl=900 upgrade=websocket loadfactor=2 |
| 70 | + BalancerMember "https://pve3:8006" route=3 keepalive=On smax=1 connectiontimeout=10 retry=600 timeout=900 ttl=900 upgrade=websocket loadfactor=5 |
| 71 | + ProxySet stickysession=ROUTEID |
| 72 | + # ProxySet lbmethod=byrequests |
71 | 73 | </Proxy>
|
72 | 74 |
|
73 | 75 | </IfModule>
|
|
80 | 82 |
|
81 | 83 | SSLProxyEngine On
|
82 | 84 |
|
83 |
| - SetEnv force-proxy-request-1.0 1 |
84 |
| - SetEnv proxy-nokeepalive 1 |
| 85 | + # don't know the original author's motivation for saying force-proxy-request-1.0, but it seems to be incompatible with websocket proxies |
| 86 | + #SetEnv force-proxy-request-1.0 1 |
| 87 | + #SetEnv proxy-nokeepalive 1 |
85 | 88 |
|
86 | 89 | SSLProxyVerify none
|
87 | 90 | SSLProxyCheckPeerCN off
|
88 | 91 | SSLProxyCheckPeerName off
|
89 | 92 | SSLProxyCheckPeerExpire off
|
90 | 93 |
|
91 |
| - # a lot of this config came |
92 |
| - # from https://forum.proxmox.com/threads/config-dump-apache-load-balancer-fail-over-and-reverse-proxy.131217/ |
93 |
| - # but some straight from https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxyrequests |
94 |
| - ProxyPass "/" "balancer://pvecluster/" stickysession=JSESSIONID|jsessionid nofailover=On |
95 |
| - ProxyPassReverse "/" "balancer://pvecluster/" |
| 94 | + <Location / > |
| 95 | + |
| 96 | + # Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly" env=BALANCER_ROUTE_CHANGED |
| 97 | + |
| 98 | + # a lot of this config came |
| 99 | + # from https://forum.proxmox.com/threads/config-dump-apache-load-balancer-fail-over-and-reverse-proxy.131217/ |
| 100 | + # but some straight from https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxyrequests |
| 101 | + # The combination of reverseproxy, load balancer, sticky sessions is not very well documented, |
| 102 | + # and I ended up adapting this: https://vaadin.com/docs/latest/flow/production/reverse-proxy |
| 103 | + ProxyPass "balancer://pvecluster/" stickysession=ROUTEID nofailover=On |
| 104 | + # upgrade=websocket |
| 105 | + ProxyPassReverse "balancer://pvecluster/" |
| 106 | + </Location> |
96 | 107 |
|
97 | 108 | </IfModule>
|
98 | 109 |
|
|
0 commit comments