iRule on BIG-IP
sometimes we want to load balance with string that contain at URI.
for example we want to load balance with this specification :
We have 10 server with specific purpose, but we want to join this service at one virtual server.
192.168.0.1 & 192.168.0.2 for data purpose
192.168.0.3 & 192.168.0.4 for download purpose
192.168.0.5 & 192.168.0.6 for mail client purpose
192.168.0.7 & 192.168.0.8 for open source purpose
192.168.0.9 & 192.168.0.10 for default
So,
create 5 pools with member and port specified.
After that create iRule, name this iRule as "lbtry" :
when HTTP_REQUEST {
switch [HTTP::uri] {
/data { pool data_pool }
/download { pool dload_pool }
/mail { pool mail_pool }
/opensource { pool os_pool }
default { pool def_pool }
}
Finally, create virtual server with include iRule "lbtry" without define Default Pool.
Now we can load balance based on URI.
Thanks to Mas Anang n Mas Taufik for gimme a chance for developing this.