Hi
I am new to HAproxy so here is the scenario
I have built a 2x Haproxy servers in HA with keepalived. they are working fantastic but my problem i have is this
VIP is xxx.xxx.xxx.10
app1 is xxx.xxx.xxx.11
app2 is xxx.xxx.xxx.12
when we open web servers using VIP, the VIP send traffic to both servers and also translates their original IP address in the web browser and we don’t want that.
Example Web browser —> xxx.xxx.xxx.10 —> xxx.xxx.xxx.11
Here is the configuration
global
log 127.0.0.1 local0
log 127.0.0.1 local1 debug
maxconn 45000 # Total Max Connections.
daemon
nbproc 1 # Number of processing cores.
stats socket /var/run/haproxy.sock mode 600 level admin
stats timeout 1m
defaults
timeout server 86400000
timeout connect 86400000
timeout client 86400000
timeout queue 1000s
listen stats xxx.xxx.xxx.11:9000
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /stats
stats auth admin:admin
[HTTP Site Configuration]
listen http_web xxx.xxx.xxx.10:80
mode http
balance roundrobin # Load Balancing algorithm
option httpchk
option forwardfor
option http-server-close
server server1 app1:80 weight 1 maxconn 512 check
server server2 app2:80 weight 1 maxconn 512 check
[HTTPS Site Configuration]
listen https_web xxx.xxx.xxx.10:443
mode tcp
balance roundrobin # Load Balancing algorithm
reqadd X-Forwarded-Proto:http
server server1 app1:443 weight 1 maxconn 512 check
server server2 app2:443 weight 1 maxconn 512 check
This is for SQL CLuster
listen sql_cluster xxx.xxx.xxx.10:3306
mode tcp
balance roundrobin # Load Balancing algorithm
#option httpchk
#option forwardfor
server server1 db1:3306 weight 1 maxconn 512 check
server server2 db2:3306 weight 1 maxconn 512 check
server server3 db3:3306 weight 1 maxconn 512 check
How to solve that
Thanks