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 ,...
Aug 21, 2019
Hi,
You can use this irule. Replace the header name to the name the reverse proxy is inserting.
# Name: persist_xff_uie
#
# To be used with UIE Persistence Profile
#
# Checks HTTP Request for 'X-Forwarded-For' header and if exists takes the first 'X-Forwarded-For' IP address as sets as
# Persist identifier.
# If the 'X-Forwarded-For' header does not exist then the client IP address is set as Persist identifier.
when HTTP_REQUEST {
if {[HTTP::header X-Forwarded-For] != ""} then {
persist uie [lindex [ split [lindex [HTTP::header values X-Forwarded-For] 0] "," ] 0]
} else {
persist uie [IP::client_addr]
}
}
Cheers,
Kees
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