Thanks will try and let you know if it works On Sep 18, 2015 7:44 AM, "Jeff Palmer" <[email protected]> wrote:
> Oh, I see now. so you want this to all be over the same port? > > > If so, your frontend would have to be in mode tcp, and you'll lose > some of the benefits of http mode. With that said, the following > should work: > > > frontend foo > bind *:80 > mode tcp > tcp-request inspect-delay 5s > tcp request content accept if HTTP > > use_backend be_http if HTTP > default_backend be_tcp > > > backend be_http > mode http > server s1 10.10.10.1:80 check > server s2 10.10.10.2:80 check > server s3 10.10.10.3:80 check > > backend be_tcp > mode tcp > ... > (add whatever your tcp config is for server 4) > > > > > Please note, I have not tested this, but in theory it should work. > it won't actually match a pattern of a client requesting /portal, > it'll just be looking for traffic coming in and then figuring out if > it's http traffic or not. if not, it gets sent to the "be_tcp" > backend. > Also, for the sake of brevity, I did not add a frontend for https, > which would traditionally listen on port 443, however other than the > SSL-centric part of the config, it should be nearly identical. > > Is this closer to what you are looking for? I know it's not exactly > what you asked for since it's not pattern matching on the URI, but I > don't believe that is possible with the frontend in TCP mode. Someone > please correct me if I'm incorrect. > > > > > > > > > > On Thu, Sep 17, 2015 at 9:48 PM, Nitesh Kumar Gupta > <[email protected]> wrote: > > We have 4 servers where tomcat is running > > > > server1 > > server2 > > server3 > > server4 > > > > > > and what i want the normal request will serve by the load balanced server > > via http or https > > server1 > > server2 > > server3 > > > > but if any request coming to access /portal that should routed through > mode > > tpc with port 80 or 443 to server4 > > > > > > IS that making clear you or need more explanation > > > > > > On Fri, Sep 18, 2015 at 7:11 AM, Jeff Palmer <[email protected]> wrote: > >> > >> Can you give us an example scenario? Tell us the actual services you > >> want to use on the frontends and backends. and how you would envision > >> your conditions to work? > >> > >> > >> > >> On Thu, Sep 17, 2015 at 9:39 PM, Nitesh Kumar Gupta > >> <[email protected]> wrote: > >> > But how it will be conditional > >> > Mean suppose if I want anything that will access help that should go > to > >> > TCP > >> > rest should work with normal http or HTTPS > >> > How can I configure this one > >> > > >> > On Sep 18, 2015 7:05 AM, "Jeff Palmer" <[email protected]> wrote: > >> >> > >> >> You can have haproxy listen in both http mode, and tcp mode. You'll > >> >> just need to setup multiple frontends. > >> >> > >> >> > >> >> something like: > >> >> > >> >> frontend myhttpservice > >> >> bind *:80 > >> >> mode http > >> >> ... > >> >> > >> >> > >> >> frontend mytcpservice > >> >> bind *:3306 > >> >> mode tcp > >> >> ... > >> >> > >> >> > >> >> > >> >> If I misunderstood the request, please feel free to post again, and > >> >> clarify what you are asking to have haproxy do. > >> >> > >> >> > >> >> > >> >> On Thu, Sep 17, 2015 at 9:13 PM, Nitesh Kumar Gupta > >> >> <[email protected]> wrote: > >> >> > Hi, > >> >> > > >> >> > I want to setup haproxy in way there that will work on both http > and > >> >> > https > >> >> > and also tpc but that will be conditional mean if any perticular > link > >> >> > will > >> >> > come that will go via tcp > >> >> > > >> >> > So can you help me how can i setup this > >> >> > > >> >> > -- > >> >> > Regards > >> >> > Nitesh Kumar Gupta > >> >> > >> >> > >> >> > >> >> -- > >> >> Jeff Palmer > >> >> https://PalmerIT.net > >> > >> > >> > >> -- > >> Jeff Palmer > >> https://PalmerIT.net > > > > > > > > > > -- > > Regards > > Nitesh Kumar Gupta > > > > -- > Jeff Palmer > https://PalmerIT.net >

