Tried converting it to type: string.. but its always empty :(
# table: nocache, type: string, size:1024, used:0
# table: nocache, type: ip, size:30, used:0
The frontend config is:
mode http
acl allowed sc2_conn_cur lt 2
balance roundrobin
default_backend ds-backend
option httplog
option accept-invalid-http-reques
stick store-request hdr(X-Forwarded-For)
stick-table type string len 20 expire 5m store gpc0
tcp-request content track-sc2 hdr(X-Forwarded-For)
Jarno Huuskonen wrote on 03/24/2015 02:23 PM:
Hi,
On Tue, Mar 24, Klavs Klavsen wrote:
#create a stick-table of 30 IPs for storing active IPs, 5 minute timeout
stick-table type ip size 30 expire 5m store gpc0
#populate the table with the X-Forwarded-For header
stick store-request hdr(X-Forwarded-For)
You've created type ip stick table, but I think hdr(X-Forwarded-For)
returns a string. Do you see any entries in the stick table:
show table nocache -> to stats socket
Maybe it's possible to use one of the converters
to map str -> ip
(http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.1-map)
or try with a string stick table:
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-stick-table
-Jarno
--
Regards,
Klavs Klavsen, GSEC - k...@vsen.dk - http://www.vsen.dk - Tlf. 61281200
"Those who do not understand Unix are condemned to reinvent it, poorly."
--Henry Spencer