You can just use the pool command with the member. You don’t need to use LB::reselect in this case. The pool wiki page has some examples (Click here).
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "xyz.com" } {
pool myPool member 10.1.2.100 80
} elseif {[string tolower [HTTP::host]] equals "abc.com" }
pool myPool member 10.1.2.200 80
} else {
take some default action?
}
}
You might also want to check if the pool member is up before using it. You can do this with LB::status pool member (Click here)
Or, you might want to consolidate those two “string tolower”'s into one with a switch to avoid unnecessary memory allocations.
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"xyz.com" {
pool myPool member 10.1.2.100 80
}
"abc.com" {
pool myPool member 10.1.2.200 80
}
default {
take some other action.
}
}
}
Guys .. qq sa this virtual server is already having one irule i just got confused over what sequence traffic will hit iruule.. i mean this is what UI shows me :
irule1 - triger on even http_request
irule2 - triger on even http_request
irule3 - triger on even http_response
Also let me add that change too to save mem .. thanks allot
If you’re not decrypting the SSL, you won’t be able to inspect the HTTP headers or data. If you need to pass the request via SSL to the pool, you could decrypt the traffic using a client SSL profile, parse the data as HTTP with an HTTP profile and then re-encrypt it on the server side using a server SSL profile.
ah .. so that means if i have to put any rule on VS handling https i have to put certificates + private key on BIG-IP itself to decrypt and then encrypt it again ? I
I have applied the rule on a virtual server where :
1. No default pool is there
2. No persistance profile is set of any kind
3. Round robin is used for load balancing.
I doubt that once the session is established BIG-IP wouldnt apply the irule to the packet that follow. Cause i verified that bigip did get the hostname correct but didnt redirect the packets to the member i want to