You mentioned that you have just ONE node in the pool, but in your example you are referring to TWO:
https://virtualserver/app1 --> node1/app1
https://virtualserver/app2 --> node2/app2
Assuming you have really just ONE node in the pool, there is nothing you must adjust with an iRule, because the incoming URI (/app1 or /app2) will be used towards the node/server as well.
But if you really have different nodes/servers for different URIs you can create a dedicated pool for each URI and handle the pool assignment via iRule (no default pool configured on the VS). Depending on the amount of different URIs you can either work with the switch-statement or just with simple if-statements.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/app1" } {
pool
} elseif { [HTTP::uri] starts_with "/app2" } {
pool
} ....
}
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/app1*" {
pool
}
"/app2*" {
pool
}
...
}
}
As you mentioned that your VS is running on port 443, I assume you have the certificate installed on the BIG-IP.
Ciao Stefan 🙂