Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4723

Condition with path_reg and map_reg with regexp

$
0
0

Currently, I have a bunch of rules in haproxy.cfg like this:

frontend frontend-https
bind 10.30.1.120:443
redirect prefix http://customerwebapp.com/redir.jsp?customer_domain_id=123 code 301 if { hdr(host) -m sub example.com
}
default_backend backend-https

but I want to integrate a map file and take all the rules sets out with something like this:

frontend frontend-https
bind 10.30.1.120:443
redirect prefix (%[req.hdr(host),lower,map_reg(/etc/haproxy/redirect.map)] code 301

}
default_backend backend-http

and the file would contain something like this
(\w..)?.customer.com(.) https://webapp.com/redir.jsp?customer_domain_id=123

I know it’s missing the conditional, “if { hdr(host) -m sub example.com” but I’m not sure how to integrate them.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4723

Trending Articles



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