How do I make an iRule that has a Context that needs to be rewritten before forwarded to a pool ?
I have a working context switching rule that needs to be updated with rewriting of the url as well.
The working iRule looks like this.
when HTTP_REQUEST {
if { [HTTP::uri] contains "/streaming/node1" } {
pool pool1_http
} elseif { [HTTP::uri] contains "/streaming/node2" } {
pool pool2_http
} else {
pool pool_http
}
}
My problem has been to add the rewrite to the same rule.
Before I forward each session i would like to change the string that contains the same statement
for example
"/streaming/node1" to “/external" and then forward to the pool1_http in this case
and then
elsif next string "/streaming/node2" rewrite to “/external" and then forward to pool2_http
and then last else statement to
pool pool_http
Im very new to iRules so I hope I dont upset to much of the Feng Shui with this question.
//Peter