I am upgrading our load balancers (haproxy 1.8.20 to haproxy 2.4.12) and some of the original configurations are deprecated. The one giving me the most trouble is reqirep. I understand that I need to use http-request replace-header instead of reqirep. I’ve learned that doing a simple find/replace reqirep with http-request replace-header won’t work given the current syntax we’re using. Hoping someone can help me understand this syntax better.
My current configuration with reqirep. Do I understand it correctly that reqirep uses two parameters (search and replace)? How can you tell where the search parameter ends and the replace parameter starts?
Replace a regular expression with a string in an HTTP request line
in other words it can match&replace every HTTP request line, including the first line, which is not technically a HTTP header.
What you are really trying to do here is rewrite the URI. So, to rewrite the URI, you’d use http-request replace-path or http-request replace-pathq instead. Don’t use http-request replace-uri for the reason mentioned in the documentation.
Thank you for the response! When you say don’t use replace-uri for the reason mentioned in the documentation are you referring to where it might fail in HTTP/2? I ask because I ended up using replace-uri and that got me up and running.