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

Help with reqrep

$
0
0

@jeffg wrote:

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&parameter2=efgh&parameter3=ijkl
I would like haproxy to modify it to remove parameter2: http://host/blah?parameter1=abcd&parameter3=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&parameter2=somethingnew&parameter3=ijkl

Any help you could offer would be very appreciated!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>