Using http-request set-uri

I am migrating from on-prem sentry to cloud. I want to use HAProxy to map DSNs and redirect traffic to cloud while code is updated to replace old DSNs with new ones. I have a long list of DSN mappings like -> ->

first DSN being old on-prem and second being corresponding cloud DSN

I am trying to use something along the lines of

http-request set-uri if { url }
http-request set-uri if { url }

and so on for very many DSN pairs. I want to match the entire DSN and replace it with another. Both being different and each pair being unique

I am aware of GOReplay but it has its own limitations and I want to explore HAProxy route.

Is this approach a good idea?

I’m having trouble finding documentation for syntax of if clause. Anyone got link handy? Closest I’ve found so far is this one. Is the syntax above correct? haproxy -c does not complain about it.

Any thoughts on what would be good approach to doing this?