Hello,
This is a followup to my post and Baptiste's answer on 20141120.
Unfortunately, I couldn't get this to work.
I am trying to achieve the following : when a response from the
application server contains a header named X-test, send the following
requests from the client IP to another backend. The goal is to send
clients who abuse the servers to a slower queue.
Here is my current config :
In the frontend:
stick-table type ip size 50k expire 5m store gpc0
tcp-request content track-sc2 src
#use_backend slow if { sc2_get_gpc0 gt 0 }
In the backend:
acl mark_as_CPUusage sc2_inc_gpc0 gt 0
acl unmark_as_CPUusage sc2_clr_gpc0 gt 0
tcp-response content accept if { res.hdr(X-test) -m found }
mark_as_CPUusage
#tcp-response content accept if ! { res.hdr(X-test) -m found }
unmark_as_CPUusage
I used capture response header to confirm that the application server
sends the X-test header for some clients.
By querying the stats through unix socket commands, I get gpc0=0 for
every client IP, so this doesn't seem to work.
Any idea about what I'm missing ?
Sylvain.