Forum Discussion
Sam10
Aug 21, 2019Altostratus
client connection persistence using an irule
I am working on an application setup. All the connections to the VS are from a reverse proxy and the client connection need to a persistence session. reverse proxy will fwd client ip in the header ,...
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)
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