MrGlass_204919
Sep 01, 2017Nimbostratus
HTTP 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 tolower [HTTP::uri]] {
"/business/portal*.js" -
"/business/portal*.js\?*" -
"/business/portal*.svgz" -
"/business/portal*.svgz\?*" -
"/business/portal*.png" -
"/business/portal*.png\?*" {
log local0. "Static"
Static content to DMZ
pool EXP_business.x.x-static pool_HTTP
persist none
Disable serverside SSL
SSL::disable serverside
Change host header to x-client-x.x.x
if { [HTTP::host] equals "business.x.x"} {
if {[HTTP::uri] contains "business/portal/"} {
HTTP::header replace "Host" "x-client-x.x.x"
log local0. "Rewrite business portal"
}
}
}
default {
Dynamic Content to seal
pool EXP_business.x.x-https_pool
log local0. "Default"
}
}
`
}
This irule is however insufficient seeing that everytime there is a new context we need to modify the irule.
Thus i have created a new irule that is now working on a NOT parameter: IF path begins with "/business/portal"
and is not "/business/portal.html"
`when HTTP_REQUEST {
log local0. "Request: [HTTP::uri]"
switch -glob [string tolower [HTTP::uri]] {
"business/portal." && [HTTP::path] ne "busines/portal.*html" } {
pool EXP_business.x.x-https_pool
log local0. "Default"
} else {
Static content to DMZ
Disable serverside SSL
Change host header to x-client-x.x.x
pool EXP_business.x.x-static-pool_HTTP
persist none
SSL::disable serverside
if { [HTTP::host] equals "business.x.x"} {
if {[HTTP::uri] contains "business/portal/"} {
HTTP::header replace "Host" "x-client-x.x.x"
log local0. "Rewrite business portal"
}
}
}
}
Can you guys tell me if this will work? Next monday will test the irule and i am trying to do it good in one go.