Forum Discussion
Allwin_179373
Nimbostratus
May 21, 2017can we direct traffic based on their cookie to a particular server using iRules
Hi,
can we direct traffic based on their cookie to a particular server using iRules?
The requirement is as below.
If mylogin.sgx.com and mylogin.access.sgx URLs contain this cookie- amlbcoo...
jaikumar_f5
Noctilucent
May 22, 2017I aint good at Irule 🙂 But logic would be like this I believe,
when HTTP_REQUEST {
set DEBUG 0
set PDC_OpenAM_pool ""PDC_OpenAM_pool""
set SDC_OpenAM_pool ""SDC_OpenAM_pool""
if { [HTTP::cookie exists ""amlbcookie""] }
{
if { [HTTP::cookie value ""amlbcookie""] equals ""01"" }
{
if { $DEBUG } { log local0. ""CLIENT IP is [IP::client_addr] $PDC_OpenAM_pool selected"" }
pool $PDC_OpenAM_pool
}
elseif {[HTTP::cookie value ""amlbcookie""] equals ""03"" }
{
if { $DEBUG } { log local0. ""CLIENT IP is [IP::client_addr] $SDC_OpenAM_pool selected"" }
pool $SDC_OpenAM_pool
}
}
}
You can also use active_members logic to control redundancy.
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
