mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
set the log format first, +Q vars still show up
This commit is contained in:
@ -62,13 +62,13 @@ frontend http-in
|
||||
# bind 127.0.0.1:80 accept-proxy
|
||||
option forwardfor
|
||||
|
||||
# custom log format
|
||||
log-format "{\"cc\":%{+Q}[capture.req.hdr(1)],\"tp\":%{+Q}[var(txn.fp_custom)],\"tpl\":%{+Q}[var(txn.fp_custom_lookup)],\"cip\":\"%ci\",\"cp\":\"%cp\",\"hh\":%{+Q}[capture.req.hdr(0)],\"backend\":\"%b\",\"server\":\"%s\",\"timers\":\"%TR/%Tw/%Tc/%Tr/%Ta\",\"status\":\"%ST\",\"bytes\":\"%B\",\"bs\":\"%U\",\"conns\":\"%ac/%fc/%bc/%sc/%rc\",\"q\":\"%sq/%bq\",\"req\":%{+Q,+E}r,\"GeoIP_Source\":\"GeoIP_Source=%ci\"}"
|
||||
|
||||
# tfp lua dev test (with lookup mapping)
|
||||
http-request lua.set_tfp
|
||||
http-request set-var(txn.fp_custom_lookup) var(txn.fp_custom),map(/etc/haproxy/map/lfp.map)
|
||||
|
||||
# custom log format
|
||||
log-format "{\"cc\":%{+Q}[capture.req.hdr(1)],\"tp\":%{+Q}[var(txn.fp_custom)],\"tpl\":%{+Q}[var(txn.fp_custom_lookup)],\"cip\":\"%ci\",\"cp\":\"%cp\",\"hh\":%{+Q}[capture.req.hdr(0)],\"backend\":\"%b\",\"server\":\"%s\",\"timers\":\"%TR/%Tw/%Tc/%Tr/%Ta\",\"status\":\"%ST\",\"bytes\":\"%B\",\"bs\":\"%U\",\"conns\":\"%ac/%fc/%bc/%sc/%rc\",\"q\":\"%sq/%bq\",\"req\":%{+Q,+E}r,\"GeoIP_Source\":\"GeoIP_Source=%ci\"}"
|
||||
|
||||
# optional geoip handling (maps required) and alt-svc header addition
|
||||
http-request set-var(req.xcc) src,map_ip(/etc/haproxy/map/geoip.map)
|
||||
http-request set-var(req.asn) src,map_ip(/etc/haproxy/map/iptoasn.map)
|
||||
|
Reference in New Issue
Block a user