w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
haproxy with miltiple backend
 /****************************************************/
           ROUTING BY SUB-Domain

     frontend http-in
          bind *:80
          acl app_ap hdr_end(host) -i apxxx.domain.com 
          acl app_dc hdr_end(host) -i dcxxx.domain.com

           use_backend ap_bk_https if app_ap
           use_backend dc_bk_https if app_dc


 Now all request from apxxx.domain.com and dcxxx.domain.com will be
redirected to your respected backends.
 /**********************************/




 /*************** OLD ANSWER ************************///
        Basically what you want is to route by domain name.
        Here's an example which does exactly what you want. Have a look at
it. Its simple .

       http://seanmcgary.com/posts/haproxy---route-by-domain-name

 /**  OLD ANSWER ENDS ************/

I hope this will solve your problem.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.