I have a path I’m using to identify itself to for an acl but I need a different path for the backend server. How do I remove the first three characters of the path before passing to the backend? passed in the path is /rd/asdffdsa1213 and to the backend server it should be /asdffdsa123.
backend backend-http
option forwardfor
server web-1 site.website1.com:80 check
Is that possible? I saw an example using this.
http-request set-uri %[url,regsub(^/rd,/,)]
Is that the right approach? I tried it but it gave me an error. It may be the version of haproxy.
[root@pm-prod-haproxy01 b738cbea49eaded323220988d9e184ee]# haproxy -f /etc/haproxy/haproxy.cfg
[ALERT] 163/161449 (10421) : parsing [/etc/haproxy/haproxy.cfg:45]: 'http-request' expects 'allow', 'deny', 'auth', 'redirect', 'tarpit', 'add-header', 'set-header', 'replace-header', 'replace-value', 'set-nice', 'set-tos', 'set-mark', 'set-log-level', 'add-acl', 'del-acl', 'del-map', 'set-map', but got 'set-uri'.
[ALERT] 163/161449 (10421) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[root@pm-prod-haproxy01 b738cbea49eaded323220988d9e184ee]# haproxy -v
HA-Proxy version 1.5.18 2016/05/10
Copyright 2000-2016 Willy Tarreau <willy@haproxy.org>
[root@pm-prod-haproxy01 b738cbea49eaded323220988d9e184ee]#