Forum Discussion
iRule for pool redirection based on uri
Pool AAA member x.x.x.x port 80
Pool BBB member y.y.y.y port 8443
Pool CCC
member x.x.x.x port 8080
Request for projects.com has to be redirected to Pool AAA
Request for xyz. projects.com has to be re directed to pool BBB.
Request for sss.xyz.projects.com should go to pool CCC.
I have configured some irule with “contains” switch glob” but somehow redirection for sss.xyz.projects.com is not working.Other 2 are fine.
Please to be keep in mind that the pool members of pool AAA&CCC are same and only port differs...Appreciate any help....
Thanks
- dubdub
Nimbostratus
Does your switch statement list the "sss.xyz.projects.com" clause first? Can you post the switch portion of the rule?
- RossVermette
Nimbostratus
Try this:
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "projects.com" { pool AAA } "xyz. projects.com" {pool BBB} "sss.xyz.projects.com" { pool CCC } } }
- Sanal_Babu
Altostratus
Hello RossVermette,
This is what exactly i have tried but the traffic is not passing to the pool CCC.
Thanks
- Sanal_Babu
Altostratus
Update :
When i apply the irule, projects.com and sss.xyz.projects.com works fine. But the second URL which is xyz.projects.com is not working.Any thoughts ?
Thanks
- Faruk_AYDIN
Altostratus
Hi Guy,
Ross's answer is correct, but there is a mistake. You must delete the blank in "xyz. projects.com". Corrected version is:when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "projects.com" { pool AAA } "xyz.projects.com" {pool BBB} "sss.xyz.projects.com" { pool CCC } } }
Recent Discussions
Related Content
* 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