# Updating haproxy.cfg

**URL:** <https://discourse.haproxy.org/t/updating-haproxy-cfg/6969>\
**Category:** Help!\
**Created:** [October 11, 2021, 5:53am UTC](https://discourse.haproxy.org/t/updating-haproxy-cfg/6969 "2021-10-11T05:53:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cosworth](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@Cosworth](https://discourse.haproxy.org/u/Cosworth)\
**Post date:** [October 11, 2021, 5:53am UTC](https://discourse.haproxy.org/t/updating-haproxy-cfg/6969/1 "2021-10-11T05:53:35Z")

</div>

Hello,

Updated Haproxy and now everything is just horribly broken.

My original backend in prior version of Haproxy looked like this;

backend backend1  
reqrep ^([^\ :]_)\ /backend1/(._) \1\ /\2  
reqadd X-Script-Name:\ /backend1  
option forwardfor  
server server1 127.0.0.1:8422

That would have allowed me to type 127.0.0.1/backend1/ into the address bar of my browser, to reach the said server. Frontend was bound to port 80.

But now the problem is;

Reqrep and reqadd are no longer working???

And after googling for hours and looking through the documentation, I cannot figure out what are the appropriate replacements???

---

<div class="post-metadata">

**Author:** ![Cosworth](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@Cosworth](https://discourse.haproxy.org/u/Cosworth)\
**Post date:** [October 11, 2021, 11:31am UTC](https://discourse.haproxy.org/t/updating-haproxy-cfg/6969/2 "2021-10-11T11:31:10Z")

</div>

I tested;

backend backend1  
http-request replace-path /backend1/(.\*) /\1  
option forwardfor  
server server1 127.0.0.1:8422

But it seems to not perform as intended, as it probably loads up a wrong path? It loads favicon and website title, but the site itself remains blank.

My frontend has this;

use\_backend backend1 if { path\_beg /backend1/ }

I assumed that;

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

Would remove the /backend1/ and simply lead to [http://127.0.0.1:8422/](http://127.0.0.1:8422/)

---

<div class="post-metadata">

**Author:** ![rhada](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/rhada/32/585_2.png) [@rhada](https://discourse.haproxy.org/u/rhada)\
**Post date:** [October 12, 2021, 9:08am UTC](https://discourse.haproxy.org/t/updating-haproxy-cfg/6969/3 "2021-10-12T09:08:50Z")

</div>

Hello,  
Giving us the version you use can help. You can find it with `haproxy -vvv` command.

reqrep has been deprecated, you have to replace it with `http-request replace-uri`.

To add a custom header you can use [this](http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#4.2-http-request%20add-header)  
`http-request add-header <custom header name> <custom header value> "`
