I have many servers in another internet data center. Can i use haproxy for load balance each website in them. Follow the documentation in the backend only using private IP how to use public IP like below. If it can’t have any app can do that? Thanks.
These are my settings:
haproxy.cfg
global
daemon
maxconn 256
user haproxy
group haproxy
chroot /var/lib/haproxy
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http
bind *:80
default_backend servers
backend servers
server server public ip?
server server public ip?
server server public ip?
2
Answers
The IP address of the server can be any IP it can be reached on from the proxy. Typically it’s a private address on the same network as the server, but it doesn’t have to be – a public address of a server the other side of the world works, too.
You can do like this:
HAProxy support IP and DNS