Forum Discussion
Ryan_Kiste_7775
Nimbostratus
Jun 01, 2009Dynamic Pool redirection
I am attempting to create a dynamic irule that redirects based on the users HTTP::host. Below is a static implementation of my requirements.
when HTTP_REQUEST {
switch [HTTP::host] {
"web1.provider.net" {pool web1.provider.net}"web2.provider.net" {pool web2.provider.net}"web3.provider.net" {pool web3.provider.net}
default {HTTP::redirect Fallback Host }
}
}
When I create this rule below, the monitor downs the virtual because the http::host is not defined in the monitor or rule.
} when HTTP_REQUEST {
set poolselect [HTTP::host]
set poolredirect [HTTP::host]
switch [HTTP::host] {
$poolselect {pool $poolredirect}
default {HTTP::redirect "fallback host" }
}
}
I have created a global pool to monitor all nodes in my sub-pool shown below.
weball-pool
node 1
node 2
node 3
node 4
node 5
node 6
web1.provider.net-pool
node 1
node 2
web2.provider.net-pool
node 3
node 4
web3.provider.net-pool
node 5
node 6
The weball-pool is my default pool under my virtual resources. With weball-pool in place the dynamic rule is not working and the user gets sent to a node in the default pool.
I need a way to create an irule to be dynamic to minimize the updates required to the script as more pools are added to the virtual instance. Is there a command that I can use for the monitor, while maintaining the dynamic script and still utilizing the fallback host in the http profile?
- Ryan_Kiste_7775
Nimbostratus
I will look into this. Thank you. I will post my end script and results. - Ryan_Kiste_7775
Nimbostratus
That exact script appears to work. If I create a global pool and add nodes and more sub-pools are added then the monitor should stay up most all the time and the user redirects if a sub-pool is down. I tried to tangle my brain around to complex of a solution.
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