Forum Discussion
Jeff_43264
May 19, 2010Nimbostratus
Hash persistence based on true-client-IP
Greetings all,
I'm working on my first iRule, because of a unique requirement I have. I am setting up load balancing for a web-based application that is very sensitive to view state, and so...
Jeff_43264
May 19, 2010Nimbostratus
One update already, I need to change the first line to use HTTP_REQUEST. When I was writing this, I was confusing this application with another one I've been working on that balances Windows RDP traffic (port 3389). But this rule is absolutely for HTTP traffic.
New code:
===================================================
when HTTP_REQUEST {
check for True Client IP header:
if { [HTTP::header exists "True-Client-IP"] } {
chuck the value into a variable
set tcip_header [HTTP::header "True-Client-IP"]
or throw in a default value, if the header isn't there
} else { set tcip_header "1.1.1.1"
}
}
select node by hashing True-client-IP value and pulling that item from the node list from the pool
set picked [lindex [active_members –list app_http_pool ] [expr [md5 [$tcip_header]] % [active_members app_http_pool]]]
send traffic to the selected pool member
pool app_http_pool member [lindex $picked 0] [lindex $picked 1] }
==================================================
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