Example 1:
HAProxy documentation for 2.6 says to use http-request replace-path <match-regex> <replace-fmt>
Assuming the path always begins with // in the app
http-request replace-path ^//(.*) /\1
I wouldn’t think one would need any if/unless statement, but modify to your needs.
Example 2:
reqirep ^(GET|POST|HEAD)\ /iframes/(.*) \1\ /\2 if iframe
This appears to be another rewrite request in which case you would use something like the first example:
http-request replace-path /iframes/(.*) /\1 if iframe
As for the Location header:
rspirep ^Location:\ /(.*) Location:\ /3dss/\1 if 3dsecure_redirect
should translate to
http-response replace-header Location (.*) /3dss/\1 if 3dsecure_redirect
Be sure to do plenty of testing. Looking at the original block and the latest new block, I’m not sure the two will give you the same results.
In 1.8, reqirep was used to rewrite a request, so a line that was always in the form of “Method URI HTTP-Version” (going a little from memory, but that looks right to me )
In 2.6, http-request replace header will ONLY replace header values, and they’re looking for the value of “^(GET|POST|HEAD)” which, though it passes syntax checks, I don’t think will actually do anything. I could be wrong, so please test thoroughly.