Forum Discussion
sandy16
Altostratus
Nov 07, 2012irule for F5 to return a message/string
Folks,
i need to do load-balancing based on the "uri" in the url. I have this working BUT need the F5 to return a http code/message like"Use /dev or /qa to go to your environments" if no uri is ...
What_Lies_Bene1
Cirrostratus
Nov 09, 2012OK, does the VS have a HTTP Profile assigned? I'm sure it does.
You may want to try Kevin's version with the commands on new lines. Or perhaps you need to exit the rule asap;
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/dev*" {
pool dev-pool
return
}
"/qa*" {
pool qa-pool
return
}
"/uat*" {
pool uat-pool
return
}
default {
HTTP::respond 200 content "Please use /dev to go to the dev-webserivces-proxies, /qa to go to the qa-webserivces-proxies, /uat to go to the uat-webserivces-proxies" noserver Content-Type "text/html" Connection Close
}
}
}
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