Forum Discussion
Jim_Mathers_131
Nimbostratus
Apr 18, 2017Check for persistence entry before invoking HTTP::respond 200 content
Hello,
I've the following simple iRule that sends a Sorry Server message when no Pool Members are active:
when HTTP_REQUEST {
if { [active_members [LB::server pool]] == 0 } {
HTTP::r...
crodriguez
Apr 18, 2017Ret. Employee
You can use [HTTP::cookie exists ] to see if a persistence cookie was passed from the client to BIG-IP. By default, the name of the cookie is "BIGipServer" - so if your pool is named "http_pool" the cookie name is "BIGipServerhttp_pool" (You'll need to check your cookie persistence profile to see if the persistence cookie is named something other than the default.)
For example:
when HTTP_REQUEST {
if { ![HTTP::cookie exists "BIGipServerhttp_pool"] } {
if { [active_members [LB::server http_pool]] == 0 } {
HTTP::respond 200 content "The application is currently unavailable"
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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