frontend http
bind *:8000
acl v1 hdr(ContentType) ??
acl users_create path_reg ^/users/create/?
use_backend users_create if users_create v1
The requests are going to have “Content-Type: application/vnd.hello.v1+json”. Not sure how I can match just the v1 part.
Thanks!
hdr_sub will match if the header contains the specified substring.
acl v1 hdr_sub(Content-Type) v1You can alternatively use hdr_reg to match on a regular expression.
Other hdr options exist for matching just the beging or end of a string in a header, and other attributes. See docs for details: https://code.google.com/p/haproxy-docs/wiki/MatchingLayer7