Urlp(room) -f file

I have a file with this content


I would like to use this acl aclKey urlp(room) -f /file/path/text.key for use_backend but it’s not working. Any solution for this ?

Does it work without the file reference?

Yes, with file reference it’s not working just like what I intended to. So, I think the bug is by using the file reference.

I tried using it directly without using ACL and the result is same.

    ## Room Name
    use_backend AMERICA if { urlp(room) -i -f /etc/haproxy/namerica.lst }
    use_backend AMERICA if { urlp(room) -i -f /etc/haproxy/namerica.lst }
    use_backend EUROPE if { urlp(room) -i -f /etc/haproxy/samerica.lst }
    use_backend EUROPE if { urlp(room) -i -f /etc/haproxy/samerica.lst }

My goal here is to get the “sampleRoom” in https://sample.com/api?room=sampleRoom and check the lst file if the sampleRoom exist in any of my .lst files and if it exist it will use the backend given. I used -i to ignore case sensitive and -f for file reference.

If it doesn’t exist, the traffic will go to defaultbackend and save sampleRoom in sticktables and use subnets to load balance.

    acl aclAsia src -f /etc/haproxy/subnets/asia.subn
    acl aclNAmerica src -f /etc/haproxy/subnets/northamerica.subn
    acl aclSAmerica src -f /etc/haproxy/subnets/southamerica.subn
    acl aclEurope src -f /etc/haproxy/subnets/europe.subn

My real problem is even if the room exist in my lst file it will directly go to defaultbackend and bypass use_backend conditions. But, without file referrence it’s working.

I need file reference because my lst file contains 100s of room names

So, in other words, matching it directly works just fine?

use_backend AMERICA if { urlp(room) -i Room1 }