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

Http-request redirect with map file and query

$
0
0

@sysadmin0505 wrote:

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.

Posts: 1

Participants: 1

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>