There are three machines, ABC,
All requests are sent to A, and then A forwards it to BC, and BC handles the business
Assume that the domain name is bla.com
on machine A , write the following configuration in the http module, access bla.com
, and access the A default page
upstream bla.com {
ip_hash;
server 192.168.100.2;
server 192.168.100.3;
}
How can all requests be forwarded to B and C according to
ip_hash
https load balancing architecture is as shown in the figure, which is not much different from http
You mean, you don’t want server A to bear the traffic?
When server A forwards to the backend, set a special header
When B and C find the HELLO header, they immediately return 302, allowing the user to directly initiate a connection to B and C