Reputation: 103
I want to config Haproxy to route traffic based on querystring. In particular...
Any ideas how to do this? Thanks in advance!
Upvotes: 2
Views: 3164
Reputation:
You're probably looking for urlp
(aka url_param
) to fetch sample from query string.
Something like this perhaps?
acl lookup path_beg /lookup
acl related path_beg /related
acl loc urlp(loc) -m found
use_backend xxx if lookup
use_backend yyy if related loc
use_backend zzz if related !loc
NOTE: lookup
and related
ACLs check if the URL begins with the path (not "in the" path). Also loc
ACL checks if the query parameter exists even if it's empty. You need to change it a bit if it doesn't exactly fit your case.
Upvotes: 3