Hi,

On Mon, 2025-08-25 at 11:00 +0000, Tom Braarup wrote:
> Hello,
> 
> How do I use "ltrim"
> (https://www.haproxy.com/documentation/haproxy-configuration-manual/l
> atest/#7.3.1-ltrim) ?
> 
> Trying to do a redirect short.com/123456 to example.com/id123456
> http-request redirect location
> https://example.com/id%[path,ltrim(/)] if { req.hdr(host) -i
> short.com && path_reg -i ^/\d+$ }
> 
> But I am getting a error:
> error detected in proxy 'example.com_443' while parsing 'http-request
> redirect' rule : expects 'code', 'prefix', 'location', 'scheme',
> 'set-cookie',
> 'clear-cookie', 'drop-query', 'ignore-empty' or 'append-slash' (was
> 'ltrim(/)]').
> 

Which version of haproxy do you use (haproxy -vv) ?
I just tested with 3.2.x and ltrim appears to work.

-Jarno

-- 
Jarno Huuskonen

Reply via email to