I'm trying to use single HAproxy Loadbalancer for multiple sites, but only one site is working for me cp_nodes
, when I try to access second website it redirects to first website only.
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
#Application Setup
frontend http_front
bind *:80
#redirect scheme https if !{ ssl_fc }
stats uri /haproxy?stats
acl cp_domains hdr(host) -i cloud.one.net
acl admin_doamins hdr(host) -i cloud.two.net
use_backend cp_nodes if cp_domains
use_backend admin_nodes if admin_doamins # Not working, redirects to cp_nodes onlye
frontend https_front
bind *:443 ssl crt /etc/pki/cloud.pem
stats uri /haproxy?stats
acl cp_domains hdr(host) -i cloud.one.net
acl admin_doamins hdr(host) -i cloud.two.net
use_backend cp_nodes if cp_domains
use_backend admin_nodes if admin_doamins
backend cp_nodes
balance roundrobin
server siteone.net 18.24.162.155:443 ssl check verify none
server sitetwo.net 18.24.162.142:443 ssl check verify none
backend admin_nodes
balance roundrobin
server siteone.net:8081 18.24.162.155:8081
server sitetwo.net:8081 18.24.162.142:8081
Log File
Dec 27 07:37:07 lb1 haproxy[21927]: Proxy http_front started.
Dec 27 07:37:07 lb1 haproxy[21927]: Proxy https_front started.
Dec 27 07:37:07 lb1 haproxy[21927]: Proxy cp_nodes started.
Dec 27 07:37:07 lb1 haproxy[21927]: Proxy admin_nodes started.
0 Answers