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 ?