This is what I want:
www.our-domain.com/api --> server.internal.corp:8243/
Frontend:
acl api_url url_beg -i /api
acl host_wso2 hdr_dom(Host) -i www.our-domain.com
use_backend WSO2API if host_wso2 api_url
Backend:
backend WSO2API
http-request set-uri %[url,regsub(^/api,/,)] if { path_beg /api }
server server1 server.internal.corp:8243 maxconn 32 check inter 5000 source 10.100.254.49
But It doesn’t work:
haroxy log
Dec 10 11:42:41 HAPX-DMZ1-01 haproxy[13073]: 10.100.11.137:50816 [10/Dec/2019:11:42:41.187] WSO2~ WSO2API/server1 13/0/1/-1/18 502 229 - - SH-- 3/2/0/0/0 0/0 {www.our-domain.com} {0,"","",“www.our-domain.com”} “GET /api HTTP/1.1” “{www.our-domain.com}”
application logging:
10.100.254.49 - - [10/Dec/2019:11:42:41 +0100] GET /favicon.ico HTTP/1.1 405 832 https://www.our-domain.com/api Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36 0.004
So as I can see, the right backend is used but not the regsub.
Where do I go wrong ?
We are using haproxy 2.0.8