Forum Discussion
Ron_126046
Nimbostratus
Feb 24, 2014Permit specif IPs to pools, all others see simple maintenance page REPOST as requested
I have an irule set up to redirect to specific pools depending on uri. Now maintenance is being done and only specific ips need to be allowed to sites, all other get a simple web page that the site ...
Eric_St__John
Employee
Feb 24, 2014What you are doing in your current iRule would not be considered a "redirect", but URI switching. The following iRule would match an IP address against the data group "data_group_name", and if it matches it will go through the rest of your logic. If it does not match an IP in the data group "data_group_name", it will redirect to http://maintenance.domain.com If you are looking to perform a pool selection based on the IP address rather than redirect, you can change the else action.
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals data_group_name] } {
switch -glob [string tolower [HTTP::uri]] {
"/jumper" {
pool jumper_JMPRIIS_Https_Pool
log local0. "redirect irule pool jumper_JMPRIIS_Https_Pool"
}
"/" -
"/annie" -
"/bugg" -
"/charles" -
"/dog" -
"/fashion" {
pool fashion_FHSIIS_Https_Pool
log local0. "redirect irule pool fashion_FHSIIS_Https_Pool"
}
default {
pool skijump_SKJWEB_Https_Pool
log local0. "redirect irule pool skijump_SKJWEB_Https_Pool"
}
}
else {
HTTP::redirect "http://maintenance.domain.com"
}
}
}
Eric
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