Forum Discussion
SanjayP
Aug 31, 2021Nacreous
Below iRule should cater the requirement of requests coming without XFF and using persistance based on original clientIP. And also, would use persistence based on XFF for other than 200.200.200.200
when HTTP_REQUEST {
if {not [HTTP::header exists "X-Forwarded-For"] } {
persist uie [IP::client_addr]
return
} else {
set xff [lindex [ split [lindex [HTTP::header values X-Forwarded-For] 0] "," ] 0]
}
if { ([HTTP::header exists "X-Forwarded-For"]) and ($xff equals "200.200.200.200") }{
node 10.10.10.11 443
return
} else {
persist uie $xff
}
}