Hello everyone.
I am trying to redirect our legacy sites to a secondary site. I have tried various configurations and I cannot get it to work with a map file. I am able to hard code the entries, and it works. But as the entries are adding up it is becoming increasingly difficult (as you can imagine).
My legacy.map
file contains single entries. Basically part of the query string.
cst=8484-29384-1123-48483
cst=4987-63254-987-1547-87
cst=159-98778-6364-15987
You get the idea.
My haproxy.cfg
contains a ton of settings I’ve experimented with (commented out over time). Here is the one I am hoping to get the complete result from.
This is on the (only) frontend.
http-request redirect location https://mypage.com/alternate-site.html code 301 if { query map(/etc/haproxy/legacy.map) -m found }
If I do
http-request redirect location https://mypage.com/alternate-site.html code 301 if { query cst=1256-9874-4848-7898 -m found }
it works. But, as we increase these over time, that is going to become a burden to maintain.
Any thoughts or experience with this type of work? I have gone from HAProxy 1.5 to 2.0, but I am still encountering issues with this. Not sure what I’m doing wrong, but it looks like the values in the map file are being ignored.