Forum Discussion
Koti_Reddy_Kol1
Nimbostratus
Sep 14, 2018iRule for URL redirection to a pool
Hi Guys,
I’m new to iRule, can someone help with creating iRule for my requirement.
I have two URLs for PROD and DEV with same host name. I want to point PROD traffic to pool A and DEV traf...
jaikumar_f5
Noctilucent
Sep 14, 2018Edited after Stan's comment: Updated with starts_with, had missed -glob (added now)
Use any one of the below,
If else condition,
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/app/prod/" } {
pool Prod_Pool
} else {
pool Dev_Pool
}
}
Using switch,
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/app/prod/*" { pool Prod_Pool }
"/app/dev/*" { pool Dev_Pool }
}
}
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