I have to redirect my URL to the following address and then remove the 1st part of the URL and then send it to the backend.
The absolute URL is: https://test.domain.com
It should redirect to the: https://test.domain.com/portal
then I should remove the first part (Portal I mean) and then add the next parts (after /portal) to the URL and send it to the backend.
**the final URL which must send to the backend should be something like this: https://test.domain.com/dist/… **
The HAProxy version is: HA-Proxy version 1.8.4-1deb90d 2018/02/08
Now I have the following configuration:
frontend MAIN-HTTPS
bind :443 ssl transparent crt /etc/ssl/certs
acl test hdr(host) test.domain.com
reqirep ^([^\ :])\ /(.*) \1\ /portal/\2 if test
use_backend testPortal if test
backend testPortal
mode http
acl no_redir url_beg /portal
reqrep ^([^\ :])\ /(.) \1\ /portal/\2 if no_redir
http-request redirect scheme https if !{ ssl_fc }
server web-testPortal test.domain.com:100 check
please help me!