Quantcast
Viewing all articles
Browse latest Browse all 4752

Choose backend with path_beg

Hi,

I need something like this:

test.example.com/blog → will be served by 192.168.10.1:8080
test.example.com/shop → will be served by 192.168.10.2:8080

So I got this:

        acl blog_pathbeg            path_beg        -i /blog
        acl shop_pathbeg        path_beg        -i /shop
        acl test_example_hdr                 hdr(host)       -i test.example.com

        use_backend blog_backend            if      blog_pathbeg   test_example_hdr 
        use_backend shop_backend            if      shop_pathbeg  test_example_hdr 

 backend blog_backend 
                mode http
                balance roundrobin
                server blog_server 192.168.10.1:8080  check inter 5000 rise 2 fall 2

 backend shop_backend 
                mode http
                balance roundrobin
                server shop_server 192.168.10.2:8080  check inter 5000 rise 2 fall 2

But… The thing is, that my blog and shop apps are directly in 192.168.10.1:8080 and 192.168.10.2:8080 (not in 192.168.10.1:8080/blog and 192.168.10.2:8080/shop).

Can I fix this with haproxy? Or do I need to move my apps to be served by 192.168.10.1:8080/blog and 192.168.10.2:8080/shop ?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>