Forum Discussion
TMcGov_92811
Nimbostratus
Dec 04, 2009iRule 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...
hoolio
Cirrostratus
Dec 04, 2009You can use HTTP::respond (Click here) to send an HTTP response from an iRule. You could also use a switch statement to check the URI:
when HTTP_REQUEST {
Check the requested URI
switch -glob [HTTP::uri] {
"*/offAssoc/*" -
"*/ops-context-root/*" -
"*/vsserv-context-root/*" {
pool pool-pool1
}
"*/AVAMService/*" {
pool pool-pool2
}
"*/adsvc/*" {
pool pool-pool3
}
"*/provision/provisioningservice*" -
"*/profile/profileservice*" -
"*/logon/logonservice*" -
"*/module/enrichmentservice*"
"*/initialuser/createinitialuserservice*" -
"*/batchCustomer/BatchCustomerService*" {
pool pool-pool4
}
default {
HTTP::respond 404 content {Page Not FoundPage Not Found}
}
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
