Proxypass/PoxyPassReverse in HAproxy howto


I’m moving proxy setups from apache to HAProxy.
All “normal” proxy and loadbalancing setups works already. We even managed to proxy/loadbalance our Sharepoint-servers.

I have in apache these 2 rules and I want to convert them to HAproxy, but somehow I can’t get it work.

ProxyPass /
ProxyPassReverse /

Any ideas how to do this?

Thanks in advance.

Can you tell us what those 2 Apache directives do so we don’t have to dig into Apache documentation?

The user comes with an url like: then he or she will be always redirected to: on the server
It’s not possible on that server to make any adjustments, because of the fact that it is maintained by other people then we.
Hope it makes a bit clear.

Redirected (so the clients will see /path1/path2/path3 in the URI in the browsers) or Rewrite (so the client will not see /path1/path2/path3)?

Rewrite will be the thing with not visible paths.

Use reqrep:

Solved with a reqirep

frontend http
acl info hdr(host) -i
use_backend Info if info

backend Info
mode http
option forwardfor
reqirep ^([^\ :])\ /(.) \1\ /path1/path2/path3\2
http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload;
server WS001 hostname.domain.local:80 cookie S2 check