Need proper replacement for reqrep directive in 2.4

with HAP 1.8 version we have following reqrep directive in backend section

  acl isithttp10 var(txn.http10) -m beg 1.0 # identifies request with HTTP/1.0 version 
  reqrep ^(.*)\ HTTP/[^\ ]+$ \1\ HTTP/1.1 if isithttp10 # sets HTTP/1.1 in backend section for HTTP/1.0

With 2.1 and above “reqrep” directive has been deprecared and we are having issues to have same re-write functionality in 2.4 version. need help to achieve this with 2.4

Sample:
Frontend Logs:

POST /test/testService HTTP/1.0
Host: test-prd01.com
User-Agent: curl/7.77.0
Accept: /
Content-Type: application/json
soapAction: “testFunction”
Content-Length: 931

Backend logs:

POST /test/testService HTTP/1.1
Host: test-final.com
User-Agent: curl/7.77.0
Accept: /
Content-Type: application/json
soapAction: “testFunction”
Content-Length: 931

Maybe http-request replace-uri could work for replace the version tag?

Replacing 1.0 with 1.1 does not upgrade the request to 1.1, it also doesn’t make your client 1.1 aware.

Also see:

https://www.mail-archive.com/haproxy@formilux.org/msg42243.html

Thank you @lukastribus for your response. yes, agree on both points. This is our current setup in production with HAP 1.8 and didn’t had any impacts to clients. We are working with clients to upgrade to http/1.1 or latest and it’s going to be a year long journey due to several critical applications being in http/1.0. would appreciate if there is any workaround in 2.4 so that we can upgrade HAP to stable version.

Thank you @Rfraile for your response. we tried with replace-uri, replace-path and replace-value and doens’t seem to work as expected. Below is our config

acl isithttp10 var(txn.http10) -m beg 1.0
http-request replace-uri ^(.*)\ HTTP/[^\ ]+$ \1\ HTTP/1.1 if isithttp10

Our crux of the problem is backend server (istio envoy doesn’t allow http/1.0) and returns upgrade required to http/1.1.

< HTTP/1.1 426 Upgrade Required
< date: Tue, 17 May 2022 23:43:51 GMT
< server: istio-envoy
< content-length: 0
< connection: close

Haproxy 2.0 will be supported until mid 2024-Q2, this may be enough to bridge that time gap for full migration.

I’d imagine similar hacks than reqrep could be achieved with a custom LUA script, but YMMV.