Hi list, giving the configuration below, I was expecting "ok1" response instead 
of "ok2". What am I doing wrong?

/tmp/p1
====
/ ok
====

h.cfg
====
defaults
    timeout client 1m
    timeout server 1m
    timeout connect 5s
    mode http
listen l1
    bind :8000
    http-request set-var(req.path) path
    http-request set-var(req.res1) path,map_dir(/tmp/p1)
    http-request set-var(req.res2) var(req.path),map_dir(/tmp/p1)
    http-request return string ok1 content-type text/plain if { var(req.res1) 
-m str ok }
    http-request return string ok2 content-type text/plain if { var(req.res2) 
-m str ok }
    http-request return string fail content-type text/plain
====

$ haproxy -v
/ $ haproxy -v
HAProxy version 2.5.5-384c5c5 2022/03/14 - https://haproxy.org/
...
Running on: Linux 5.10.77-flatcar #1 SMP Fri Nov 5 17:49:48 -00 2021 x86_64

$ curl localhost:8000
ok2

~jm


Reply via email to