Forum Discussion
MrGlass_204919
Nimbostratus
Sep 01, 2017HTTP REQUEST - Some Assitance
Hi Folks,
I currently have an irule that is redirecting extensions behind the business/portal to a pool.
when HTTP_REQUEST {
log local0. "Request: [HTTP::uri]"
switch -glob [string tol...
MrGlass_204919
Nimbostratus
Sep 05, 2017Hi Stan,
Thanks for your answer. I am a total beginner on irules so could you please check if this is correct?
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/business/portal.*html" {
pool EXP_business.x.x-static-pool_HTTP
persist none
SSL::disable serverside
}
switch { [HTTP::host] equals "business.x.x"} {
{[HTTP::uri] contains "business/portal/"} {
HTTP::header replace "Host" "x-y-exp.x.x"
log local0. "Rewrite business portal"
"/business/portal.*" {
pool EXP_business.x.x-https_pool
log local0. "Default"
}
}
}
- Stanislas_Piro2Sep 07, 2017
Cumulonimbus
Hi,
your irule format is wrong. you merge if / then / else and switch commands, which worth work.
switch format is :
switch [options like --glob, ...] string { pattern1 { actions for pattern1 } pattern2 { actions for pattern2 } pattern3 - pattern4 { actions for pattern3 and pattern4 } default { actions if no previous pattern matches } }patterns are string (no condition) which can support wildcard if
option was set-globif / then / else format is:
if {condition1} { actions for condition1 } elseif {condition2} { actions for ondition2 } else { actions if no previous condition matches }condition can be
[HTTP::uri] equals "/portal/"
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
