Score:0

HAProxy Configuration alternative of dst_port

by flag

I am trying to route my webpage based on url and not port.

My haproxy.cfg is like this :

    frontend website-in-2345

        bind *:80
        bind *:2345
        acl website-in-2345 dst_port 2345
        acl website-in-443 dst_port 443
        acl website-in-80 dst_port 80
        use_backend website-out-2345 if { path_beg /monitorpage/ }
        #use_backend website-out-2345 if website-in-2345
        use_backend website-out-2345 if website-in-443
        use_backend website-out-2345 if website-in-80 

    backend website-out-2345

        mode tcp
        balance static-rr
        server app1-ab-a 110.01.01.111:1234 check port 1234

When i went to http://110.01.01.111:2345/monitorpage/ the page would not load.

However, if I remove the commented line in haproxy.cfg use_backend website-out-2345 if website-in-2345, the page will appear. But this will also allow another page with the same port to load e.g. http://110.01.01.111:2345/anotherpage/

How can I configure so that only /monitorpage/ will appear but not /anotherpage/

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.