Replacing reqadd with http-request set-path


#1

The HAProxy 1.7 manual says:
“Using “reqadd”/“reqdel”/“reqrep” to manipulate request headers is discouraged in newer versions (>= 1.5).”

I’ve copied the “reqadd” statements from my HAProxy 1.5.18 configuration to HAProxy 1.7.8 and now want
to update them:

acl path_licd  path_beg /licenseDetails
acl path_admin path_beg /admin /staff
acl path_data  path_beg /datamart
acl path_root  path /
reqrep ^([^\ \t]*)[\ \t]/(.*)\ (.*) \1\ /datamart/licenseDetails.do\ \3 if path_licd
reqrep ^([^\ \t]*)[\ \t]/(.*)\ (.*) \1\ /datamart/\2/languageChoice.do\ \3 if path_admin
reqrep ^([^\ \t]*)[\ \t]/\ (.*) \1\ /datamart/wiLogin.do\ \2  if path_data
redirect location /datamart/wiLogin.do if path_root

I assume the path_licd statement becomes:
http-request set-path /datamart/licenseDetails.do\ %[query] if path_licd

I assume the path_admin statement becomes:
http-request set-path /datamart/%[path]/languageChoice.do\ %[query] if path_admin

I assume the path_data statement becomes:
http-request set-path /datamart/wiLogin.do\ %[query] if path_data

I assume the redirect statement becomes:
http-request redirect /datamart/wiLogin.do if path_root

Are my “translations” correct?