Forum Discussion
Sabir_Alvi
Mar 08, 2018Altocumulus
iRule redirect to https if condition doesn't match
I need to send traffic to appr pools on port 80 based on a specific Host and URI combination and all other traffic should get redirected to https irrespective of Host and URI combination. I have below iRule that works fine for my port 80 work. Please suggest what to append to redirect traffic to https otherwise. Redirect to https should be based on [HTTP::host]
when HTTP_REQUEST {
switch -glob [HTTP::host][HTTP::uri] {
"sample1.ehosts.net/word1/word2*" { pool sample1.ehosts.net_word }
"sample2.ehosts.net/word1/word2*" { pool sample2.ehosts.net_word }
"sample3.ehosts.net/word1/word2*" { pool sample3.ehosts.net_word }
}
}
- Stanislas_Piro2Cumulonimbus
You may add the
Conditiondefault
when HTTP_REQUEST { switch -glob [HTTP::host][HTTP::uri] { "sample1.ehosts.net/word1/word2*" { pool sample1.ehosts.net_word } "sample2.ehosts.net/word1/word2*" { pool sample2.ehosts.net_word } "sample3.ehosts.net/word1/word2*" { pool sample3.ehosts.net_word } default { add the action here } } }
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