Hi All,
I would like to request help with the configuration of HAProxy. I am looking to offer a longer URL external and proxy it to internal services that only reference the last part.
I have a config like this (abbreviated to be easier to read):
frontend EXTERNAL
...
acl redirect_to_service1 path_beg -i /service1/foo/APICALL
use_backend INTERNAL-SERVICE1 if redirect_to_service1
acl redirect_to_service2 path_beg -i /service2/foo/APICALL
use_backend INTERNAL-SERVICE2 if redirect_to_service2
backend INTERNAL-SERVICE1
...
server NAME 10.0.0.1:1234 check
http-request set-uri "%[path,regsub(/service1/foo/(.*),/\1)]" # was set-path
backend INTERNAL-SERVICE2
...
server NAME 10.0.0.1:1235 check
http-request set-uri "%[path,regsub(/service2/foo/(.*),/\1)]" # was set-path
Is anyone able to offer guidance or a solution on removing the /service2/foo or /service1/foo from the request sent to the backend only? The client will still request on those API.
Thanks in advance,
Matt