Forum Discussion
ant77
Aug 30, 2021Cirrostratus
Persist profile using XFF to read client IP address
Hi All, Based on what we are using below, traffic to our website goes through a CDN that changes the "real" client's IP address to their proxy IP...So we can't use source-client IP persistency on ...
spalande
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
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects