Alan_Millar
Jul 24, 2019Nimbostratus
IP Filtering using Xff-clientip in iRule
We are currently using IP filtering for URIs like this: } elseif { ([HTTP::uri] starts_with "/site") and ( [class match [IP::client_addr] equals management_IP])} { use pool pSite ...
- Jul 25, 2019
You are right Stan! Thanks for the contribution.
, here is the new code:
when HTTP_REQUEST { if { ([HTTP::uri] starts_with "/site") } { if {[HTTP::header exists "X-Forwarded-For"]} { set clientIP [string trim [getfield [HTTP::header value "X-Forwarded-For"] "," 1] " "] if { ([class match $clientIP equals management_IP]) } { pool pSite } } else { pool pSite } } }
KR,
Dario.