Hi,

I am working on a design to do load balancing for a cluster of servers based
on URLs.

My URLs are for e.g -
http://mydomain.com/request?type=xxx
http://mydomain.com/request?type=yyy

I want to do URL load balancing based on the 'type' attribute. Sp for type
'xxx' it can goto backend_farm_x and type 'yyy' it can goto backend_farm_y..

Can someone please help me what kind of rule is it it preferable - url_reg,
url_sub, path_reg, path_sub? If anyone can point me to such samples rule, it
will be useful.

I starrted off with these rules but it didn't work -
frontend myfrontend *:80
     log    global
     maxconn 25000
     option forwardfor
#     acl acl_example1 url_reg /([a-z]+)/xxx/([a-z]+)/
#     acl acl_example2 url_reg /([a-z]+)/yyy/([a-z]+)/
#     acl acl_example1 url_reg (.*)xxx(.*)
#     acl acl_example2 url_reg (.*)yyy(.*)
#     acl acl_example1 path_sub xxx
#     acl acl_example2 path_sub yyy
     acl acl_example1 path_reg (\S+)xxx(\S+)
     acl acl_example2 path_reg (\S+)yyy(\S+)
#     acl acl_example1 path_reg xxx
#     acl acl_example2 path_reg yyy
     use_backend example1_farm if acl_example1
     use_backend example2_farm if acl_example2
     default_backend default_farm

On the server logs, it falls to the default backend. I have tried all the
combinations above.

Thanks,
Praveen.

Reply via email to