http - set frontend_ip as source IP for backend -
i have server multiple ip configured on ( virtual ip on eth0). i'm using haproxy load balacing. each ip has been configured/pointed different domain name , requests comes each ip address being forwarded different backend server using haproxy.
issue here, outgoing traffic haproxy pass through main interface ip [ default]. wanted set source ip backend connection.
i tried below config, not working. idea ?
backend web1 server ss2 10.11.12.13:80 source ${frontend_ip} frontend new1 bind 10.11.13.15:8080 mode tcp use_backend web1
you have 1 ip in question can't sure. if have multiple virtual ips , want serve different backends, need create 1 frontend
each @ least. this:
frontend new1 bind 10.11.13.15:80 ... acl is_new1domain hdr(host) -i new1.domain.com use_backend web1 if is_new1domain frontend new2 bind 10.11.13.16:80 ... acl is_new2domain hdr(host) -i new2.domain.com use_backend web2 if is_new2domain backend web1 ... source 10.124.13.15 backend web2 ... source 10.124.13.16
actually, if don't have other rules parse, use layer4 proxy/balance. this:
listen new1 bind 10.11.12.15:80 server ss1 10.11.12.90:8080 check server ss2 10.11.12.91:8080 check server ss3 10.11.12.92:8080 check source 10.124.12.15 listen new2 bind 10.11.12.16:80 server ss4 10.11.12.80:8080 check server ss5 10.11.12.81:8080 check server ss6 10.11.12.82:8080 check source 10.124.12.16
Comments
Post a Comment