Old 'reqirep' directive not supported anymore use 'http-request replace-header' instead. HELP PLS!

Hi guys I’m not a HAProxy user so in short history after upgrade our distro to Ubuntu 22.04 haproxy was upgraded too, many things are working or were fixed but I still has a little issue.

Current Version : haproxy version is 2.4.22-0ubuntu0.22.04.1
Old Version: haproxy version is 1.8-0ubuntu0.18.04.1


#FrontEnd Medidia Server (medias.int.dom)
acl host_medias.int.dom req.hdr(Host) medias.int.dom
acl collectiondata path_beg /img-collection/
acl bookstoredata path_beg /img-bookstore/
use_backend thumbor-collection if host_medias.int.dom collectiondata
use_backend thumbor-collection if host_www.mycompany.ca collectiondata
use_backend thumbor-bookstore if host_medias.int.dom bookstoredata
use_backend thumbor-bookstore if host_www.mycompany.ca bookstoredata

#Media Server (thumbor) - Collection
backend thumbor-collection
option forwardfor
option http-server-close
#Original line follow.
#reqirep ^([^\ :])\ /img-collection/(.) \1\ /\2
http-request replace-header ^([^\ :])\ /img-collection/(.) \1\ /\2
server vsp-meds-01-collection1 xxx.xxx.xxx.xxx:9010 check
server vsp-meds-01-collection2 xxx.xxx.xxx.xxx:9011 check

Since reqirep was replaced by “http-request replace-header” I try to fix the line it say that need a 3rd parameter I guess is acording to manual → here BUT what NAME means and how use it?
May someone please help me to fix it ? and better to understand how it work to solve future problems?

Just suggestion I found HA a very good product but doccu is not for newbies.

Hello :slight_smile:

reqrep (respectively reqirep) isn’t replaced by “http-request replace-header” only, but replaced by 'http-request replace-path’, ‘http-request replace-uri’ or ‘http-request replace-header’ depending on the use case.

In your case, you don’t wan’t to replace/edit a header - it seems, you are trying to replace/edit the path, so you should use:

http-request replace-path /img-collection/(.*) /\1

Unfortunately, I’m not entirely sure if that’s completely correct, but it’s the right direction :wink:

best regards,