Forum Discussion
matt1985_299432
Apr 11, 2017Nimbostratus
IRULE redirection to maintenance pool based on client IP and cookie...
Hi,
I have a requirement to redirect test clients to a maintenance pool based on client IP address and the client manually inserting a cookie. The process will be..
Server maintenance fla...
- Apr 12, 2017
I think this will do what you need...
when HTTP_REQUEST { if {[class match [HTTP::header "True-Client-IP"] equals MAINTENANCE-CLIENTS]} { if {[HTTP::cookie exists "MAINTENANCE"]} { switch -glob [string tolower [HTTP::uri]] { "/site1*" - "/site2*" - "/site3*" { pool MAINT-A; persist cookie } } go no further return } } switch -glob [string tolower [HTTP::uri]] { "/site1*" { pool POOL-A; persist cookie } "/site2*" { pool POOL-B ; persist cookie } "/site3*" { pool POOL-C; persist cookie } } }
Kevin_Davies_40
Nacreous
I think this will do what you need...
when HTTP_REQUEST {
if {[class match [HTTP::header "True-Client-IP"] equals MAINTENANCE-CLIENTS]} {
if {[HTTP::cookie exists "MAINTENANCE"]} {
switch -glob [string tolower [HTTP::uri]] {
"/site1*" -
"/site2*" -
"/site3*" { pool MAINT-A; persist cookie }
}
go no further
return
}
}
switch -glob [string tolower [HTTP::uri]] {
"/site1*" { pool POOL-A; persist cookie }
"/site2*" { pool POOL-B ; persist cookie }
"/site3*" { pool POOL-C; persist cookie }
}
}
matt1985_299432
Apr 12, 2017Nimbostratus
Hi Kevin,
That works much better certainly if I set client IP AND cookie as specified it still gets me to the maintenance pools. However not falling through to the normal pools when there is no specific cookie client IP required.. just trying to work that through
Thanks
Matt
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