Hello Everyone,
We are working on the load balancer for two cpanel servers, We have already done mysql replication and file sync. Now we are trying to setup load balancer for our site. our step details are
cpanel server 1 = x.x.x.x (IP)
cpanel server 2 = x.x.x.x (IP)
Load balancer(Nginx) = x.x.x.x (IP)
During test, Our loadbalancer sever reaches the both cpanel servers but it doesn't pull any data showing default website (For basic load balancer configuration).. So we tried to use Http header and its working for virtual domains But request send only 1st cpanel domain and another cpanel domain doesn't receive any request from load balancer. I have provided load balancer configuration. Some look this and what changes need to done to for receive request for those cpanel server domains.
load balancer config:
upstream backend {
server xxx.xxx.xxx.xxx;
server xxx.xxx.xxx.xxx;
}
# This server accepts all traffic to port 80 and passes it to the upstream.
# Notice that the upstream name and the proxy_pass need to match.
server {
listen 80;
server_name xxx.xxx.xxx.xxx;
location / {
proxy_pass
http://main ;
proxy_set_header Host example1.com:80;
}
}
server {
listen 80;
server_name xxx.xxx.xxx.xxx;
location / {
proxy_pass
http://main ;
proxy_set_header Host example2.com:80;
}
}
In cpanel server we tried to config as
http://x.x.x.x/~username/ method by uninstalling mod_ruind, but load balancer config decliend it
Thanks