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???
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/
rhada
3
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-request add-header <custom header name> <custom header value> "