Forum Discussion
greenfroguk_338
Nimbostratus
Nov 07, 2011Basic iRule to redirect to pools
Hi,
We have a VIP created and against that VIP have a very basic iRule.
The idea is that depending on two matches on the URI it directs to a different pool. I know there will be a ...
nitass
Employee
Nov 07, 2011this is mine.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.65.152:http
ip protocol tcp
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[HTTP::uri] contains "e02extport.com" and [HTTP::uri] contains "var1" } {
log local0. "pool_ext_e02_var1"
pool pool_ext_e02_var1
} elseif {[HTTP::uri] contains "e02extport.com" and [HTTP::uri] contains "var2" } {
log local0. "pool_ext_e02_var2"
pool pool_ext_e02_var2
} elseif {[HTTP::uri] contains "e02extport.com" and [HTTP::uri] contains "var3" } {
log local0. "pool_ext_e02_var3"
pool pool_ext_e02_var3
} elseif {[HTTP::uri] contains "e02extport.com" and [HTTP::uri] contains "var4" } {
log local0. "pool_ext_e02_var4"
pool pool_ext_e02_var4
} else {
log local0. "pool_ext_e02_default"
pool pool_ext_e02_default
}
}
}
[root@ve1023:Active] config curl -I http://172.28.65.152/var1/app.html?ref=https://eo2port.com
[root@ve1023:Active] config tail -f /var/log/ltm
Nov 7 04:17:36 local/tmm info tmm[6742]: Rule myrule : pool_ext_e02_default
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