Forum Discussion
Hannes_Rapp
Oct 05, 2015Nimbostratus
Hello,
If you issue a command
curl -I PoolMemberIP:PoolMemberPort/test2
from F5, you will see that the 404 error comes from the Pool Member as the page /test2 was not found. Try the same with /test1 page, and you will see the difference. Therefore, the HTTP 404 error you're mentioning is not related to F5 or this iRule. Make sure the related pages exist in the backend servers (your pool members).
Now in regards to making the iRule slimmer. We can use the user-entered HTTP path as our only conditional trigger since "abc.test.com" is your only host serviced from this particular Virtual Server.
when HTTP_REQUEST {
switch [string tolower [HTTP::path]] {
"/" {
HTTP::path "/test1"
pool pool-1111
}
"/test1" -
"/test1/" {
pool pool-1111
}
"/test2" -
"/test2/" {
pool pool-2222
} default {
pool MyDefaultPool
}
}
}