iRule for pool usage instead of VIP(s)
Hi team,
I quite new to iRule. And, I am trying to implement a common VIP, used to replace doing several independent VIPs.
So, instead of doing new VIPs, use their existing pools and only new pool(s)/node(s) will be added to the LLB.
The VIP common is "test-redirection.com", which uses the pools already made for other VIPs.
For example:
pool-service1-80
pool-service2-80
pool-service3-80
So, when it is used any of these URLs:
http://test-redirection.com/service1.com/testing or,
http://test-redirection.com/service2.com/testing or,
http://test-redirection.com/service3.com/testing
Instead of using the pool for "test-redirection.com", the iRule use the pool for service"x".com (x = 1, 2 or 3)
So, the correct server be addressed and information provided.
I am doing the iRule, like this:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/service1*" {
pool /Common/pool-service1-80
}
"/service2*" {
pool /Common/pool-service2-80
}
"/service3*" {
pool /Common/pool-service3-80
}
}
However, seems not to be working as expected.
It keeps answering with HTTP-404, URL not in this...
Any ideas, how to correct this behavior...