Hello,


We are facing a strange issue on haproxy server on our production
environment.



In DNS we point our domains/subdomains to haproxy using a cname. Our
servers are hosted on AWS.



For example, we have two subdomain pointing to haproxy.



subdomain.domain.com points to some.eip.on.aws..com

test.subdomain.domain.com points to some.eip.on.aws..com



Haproxy Config



#-------------------------------------------------------------------

# Global settings

#-------------------------------------------------------------------

global

        log             127.0.0.1 local2

        chroot          /var/lib/haproxy

        maxconn         25000

        pidfile         /var/run/haproxy.pid

        user            haproxy

        group           haproxy

        daemon





#-------------------------------------------------------------------

# common defaults that all the 'listen' and 'backend' sections will

# use if not designated in their block

#-------------------------------------------------------------------

defaults

        mode                   http

        log                        global

        option                  dontlognull

        option                  httpclose

        option                  httplog

        option                  forwardfor

        option                  redispatch

        stats            hide-version

        stats            enable

        stats            uri /haproxy?stats

        stats            refresh 5s

        balance               roundrobin

        maxconn             60000

             timeout           connect 5000

        timeout                client 50000

        timeout                server 300000

        retries                 3







#-------------------------------------------------------------------

# main frontend which proxys to the backends

#-------------------------------------------------------------------



frontend        http-in

        bind *:80



acl  url_subdomain   hdr_dom(host)   -i      subdomain.domain.com

acl  url_test                 hdr_dom(host)   -i
test.subdomain.domain.com





use_backend             subdomain                 if url_subdomain

use_backend             test                               if url_test





backend         subdomain

        server  web 10.0.0.60:19100 cookie web       check



backend         test

        server  web 10.0.0.60:19200 cookie web       check



Haproxy Version: HA-Proxy version 1.5.2 (haproxy-1.5.2-2.5.amzn1.x86_64)

OS: Amazon Linux AMI release 2014.03



Note: This is the latest version available on AWS.



Both the subdomain has different web pages. Now if we enter
test.subdomain.domain.com in the browser it goes into subdomain.domain.com
backend. We have no idea what is causing this issue.



Could you please help me solve this problem?



Additional Info:



Also we have exact same Haproxy config on QA and UAT environment and works
fine.



QA Environment:



Haproxy Version: HA-Proxy version 1.5.4

OS Version: CentOS release 6.3 (Final)



UAT Environment:



Haproxy Version: HA-Proxy version 1.3.26

OS Version: CentOS release 5.6 (Final)



--

Thanks & Regards,

Azam Sheikh Mohammed
IT Network & System Admin

D a n a t
Al-Shatha Tower Office 1305, Dubai Internet City | P.O.Box: 502113, Dubai,
UAE | Tel: +971 4 368 8468 Ext. 133 | Fax:  +971 4 368 8232 | Mobile:  +971
55 498 8089 | Email: a...@danatev.com

Reply via email to