How to Remove and Append Path for root context Based Deployment

HI Team,

WIll appreciate your quick help to get the recommended approach for achieve this. —> remove product1 from frountend ( or backend) and fwd request to backend where application is running on root context (/) and when response back it will append product1 again so that for end user URL will always remain with → froundend → remove product1 → backend → application (/) → reply and append again product1 → to users

Note : There is some serious dependency that is why we are not able to change the context path of deployment with /product1 .to achieve same.
backend application is java based application is deplored on root context (/)

I am using basic rules to redirect however for append or remove on run time I am bit confuse and looking for help please.

acl url_worklife1 path_beg -i /product1
acl url_althome hdr_dom(host) -i
use_backend dashboard if url_worklife1 url_althome

backend dashboard
mode http
stats enable
balance roundrobin
cookie JSESSIONID prefix nocache
option httpclose
option forwardfor
redirect scheme https if !{ ssl_fc }
option persist
option redispatch
http-response set-header Strict-Transport-Security max-age=31536000;\ includeSubDomains;\ preload;
server W55-01 check port 16161 inter 10s fall 2 rise 2 cookie 140-W maxconn 500


Will appreciate if you guide us how to achieve this.

Thanks in advance