LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Issue with setup loadbalacer for cpanel domains (https://www.linuxquestions.org/questions/linux-server-73/issue-with-setup-loadbalacer-for-cpanel-domains-4175634205/)

ping4support 07-16-2018 05:55 PM

Issue with setup loadbalacer for cpanel domains
 
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

scasey 07-18-2018 02:54 AM

I don't know diddly-squat about load balancing...

But, isn't that what it's supposed to do...that is, use one of the servers to respond to a request?

Why would you expect to see activity on both servers?

I even imagine (see my opening comment) that it won't use the second server until the first server has reached some presumably configurable threshold...


All times are GMT -5. The time now is 02:19 AM.