[SOLVED] Apache2/Nginx load balancing interface

XoCluTch

Member
Jul 29, 2018
24
3
8
38
I read some of the other posts on this, stating that this has been resolved. But I am still having some issues with it.

Trying to run the Proxmox's Gui through a load balancer. Nginx or Apache (I've tried both)

I pulled this config off the forums, and it works, WITHOUT the "BalanceMember" part the problem happens when I add the Balancer member part of the code

The problem I am having is the Servers Shell wont work. However VMs console does work. When I tried this config in NGINX the VMs console, only worked maybe 20-50% of the time. With Apache this appears to be fixed, however still having issues when i Try to access the servers shell

My Apache Config:

<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/crt
SSLCertificateKeyFile /etc/apache2/ssl/key


SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off

ProxyRequests off
ProxyPreserveHost on


<Proxy "balancer://proxmox">
BalancerMember "https://192.168.4.31:8006"
BalancerMember "https://192.168.4.32:8006"
</Proxy>

<Proxy "balancer://wss-proxmox">
BalancerMember "wss://192.168.4.31:8006"
BalancerMember "wss://192.168.4.32:8006"
</Proxy>

<Proxy "balancer://ws-proxmox">
BalancerMember "ws://192.168.4.31:8006"
BalancerMember "ws://192.168.4.32:8006"
</Proxy>


<Location />
ProxyPass "balancer://proxmox/"
ProxyPassReverse "balancer://proxmox/"

Order allow,deny
Allow from all
</Location>


<LocationMatch ^/(api2/json/nodes/[^\/]+/[^\/]+/[^\/]+/vncwebsocket.*)$>
ProxyPass "balancer://wss-proxmox/$1"
</LocationMatch>

<Location /websockify>
ProxyPass "balancer://ws-proxmox/"
ProxyPassReverse "balancer://ws-proxmox/"
</Location>

</VirtualHost>
 

guletz

Famous Member
Apr 19, 2017
1,523
238
83
Brasov, Romania
Hi,

I solve the same problem like yours, using haproxy(in tcp mode) because the setup is more simple for my taste. And it is work for me for almost a year.
 
  • Like
Reactions: XoCluTch

XoCluTch

Member
Jul 29, 2018
24
3
8
38
Nice thanks that fixed it... Nginx and Apache "almost" worked, but HAProxy everything seems to work on it using "mode TCP" Appreciate the help
 

guletz

Famous Member
Apr 19, 2017
1,523
238
83
Brasov, Romania
Thx. Take in account that you can use ponders for backends, so you can load your pmx nodes like: 50% connexions are going to node 1, 30% to node 2 and 20% to node 3 .
 
  • Like
Reactions: XoCluTch

XoCluTch

Member
Jul 29, 2018
24
3
8
38
frontend localhost
bind *:443
mode tcp
default_backend nodes

backend nodes
balance roundrobin
mode tcp
server xoserver01 192.168.4.31:8006 check
server xoserver02 192.168.4.32:8006 check
server xoserver03 192.168.4.33:8006 check
server xoserver04 192.168.4.34:8006 check
server xoserver05 192.168.4.35:8006 check
server xoserver06 192.168.4.36:8006 check



Thats my config.... It was sort of working, now its not displaying the consoles. Idea's?

It will work if I have only 1 server listed... like:

backend nodes
balance roundrobin
mode tcp
server xoserver01 192.168.4.31:8006 check
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!