I’m using haproxy 1.6.x. I am having a heck of a time understanding how to use reqrep. I believe this is the only option to accomplish my goal - partially due to the haproxy version, partially due to the use case. eg. I believe I need to use brackets in the regex, which regsub doesn’t support. If I was using sed, I think one option that would work would be: sed ‘s/parameter2=[^&]*&//’ I have spent an inordinate amount of time trying to figure this out without success. I would be grateful if someone could break down the usage of reqrep for me. I’ve googled plenty, but I am clearly missing something fundamental.
Use case: I am attempting to remove a query parameter in a request made to haproxy, or worst case modify the value of the query parameter.
If a query is made to: http://host/blah?parameter1=abcd¶meter2=efgh¶meter3=ijkl
I would like haproxy to modify it to remove parameter2: http://host/blah?parameter1=abcd¶meter3=ijkl
Alternatively parameters2 could have it’s value to something I define. The solution must allow for new parameters to be included. All of the other parameters must be preserved and I do know what they are ahead of time.
I could also make due with: http://host/blah?parameter1=abcd¶meter2=somethingnew¶meter3=ijkl
Any help you could offer would be very appreciated!