TMcGov_92811
Dec 04, 2009Nimbostratus
iRule for LTM to send HTTP Error code
Hello, I have a simple iRule that directs HTTP requests to certain pools based on the URI. If there is a URI that is not specified in the iRule, I would like the LTM to respond with an HTTP Error code such as a 404 or 503 instead of sending them to a default pool.
How is this constructed ?
For instance:
when HTTP_REQUEST {
if { [HTTP::uri] contains "/offAssoc/" or [HTTP::uri] contains "/ops-context-root/" or [HTTP::uri] contains "/vsserv-context-root/" } {
pool pool-pool1
} elseif {
[HTTP::uri] contains "/AVAMService/"} {
pool pool-pool2
} elseif {
[HTTP::uri] contains "/adsvc/"} {
pool pool-pool3
} elseif {
[HTTP::uri] contains "/provision/provisioningservice" or [HTTP::uri] contains "/profile/profileservice" or [HTTP::uri] contains "/logon/logonservice" or [HTTP::uri] contains "/module/enrichmentservice" or [HTTP::uri] contains "/initialuser/createinitialuserservice" or [HTTP::uri] contains "/batchCustomer/BatchCustomerService"} {
pool pool-pool4
} else {
***** LTM RESPONDS WITH A 404 ERROR !!!!!! *******
}
}