Redirect with query strings


#1

I am running haproxy 1.8.9 and have a need to redirect a url with single sign on query strings. Each member has a unique query string. The config I have now works great with a single string which is…

redirect prefix https://me.domain2.com if { hdr(host) -i me.domain1.io } { path / } { query -i cvt=012dfWs56947 }

But it only works with the one query string. Is there any easy way to set this up for multiple different query strings? Even a variable or wildcard would help because I have 1000’s of different query strings. If it isn’t possible I will need to look for a different alternative. Thanks for the help.


#2

What would the variable or wildcard contain? Explain what you actually want haproxy to do.


#3

So with what I have haproxy redirects me.domain1.io?cvt=012dfWs56947 to me.domain2.com and signs me into the site based off the query string. But, if I have a different query string it will only redirect me to the new site and doesn’t log me in. So I am looking to see if haproxy can pass any of the 1000’s of member query strings to the new site and log them in based off their unique string. Something like { query -i * } so it is not stuck on only on string.

Hopefully that makes sense. I have members with different strings to log them into the site and with the config now it only logs in member 1 with the string 012dfWs56947, but member 2 with a different string won’t get logged in.


#4

Why are you matching query in the first place then? Why not just remove it?

redirect prefix https://me.domain2.com if { hdr(host) -i me.domain1.io } { path / }


#5

Thanks for the help, removed the query and it is working like I need. Thanks again.