Forum Discussion
Lee_Sutcliffe
Aug 21, 2019Nacreous
This might give you some ideas.
The iRule will set a persistence record after the pool member has responded.
On subsequent requests (when the variable $clientIp exists) it will persist on the record it has added.
Just be cautious of this method. The client IP could be a NATed IP, so depending on what content you're serving, you could accidentally bleed other user sessions.
when HTTP_REQUEST {
if {[info exists clientIp]} {
persist uie $clientIp
} elseif {[HTTP::header exists "client-ip"]} {
set clientIp [HTTP::header value "client-ip"]
}
}
when HTTP_RESPONSE {
if {[info exists clientIp]} {
persist add uie $clientIp
}
}
(this iRule has only been syntax checked)