Forum Discussion
Sep 18, 2013
An iRule to insert an XFF and for crosscheck would look like this:
when HTTP_REQUEST {
HTTP::header insert X-Forwarded-For [IP::client_addr]
}
when HTTP_REQUEST_SEND {
if {[clientside {HTTP::header exists "X-Forwarded-For"}]} {
foreach xffvalue [clientside {HTTP::header values "X-Forwarded-For"}] {
log local0. "serverside XFF: $xffvalue"
}
}
}
Run 'tail -f /var/log/ltm' to verify the header insert in the LTM log facility.
Actually the foreach-loop is able to test for multiple XFF headers.