Request Header Referer equal to root

Hello everyone,

I’m trying to check for a condition where the Request Header referer is equal to the root path
I’m doing it like this:

acl static-list-referer-root hdr_dir(referer) path -i /
use_backend static-businesses-list if { path_beg /_next } static-list-referer-root

It’s not working for the root, however if I try with a different path it works fine…
Thank you for your help HAProxy Community ^.^

It doesn’t work like this, path and friends are about the request, not about what’s in the referer.

Use regex on hdr(referer) to match your path or see if other string comparison like subdir or suffix match can help.