Forum Discussion

sandy16's avatar
sandy16
Icon for Altostratus rankAltostratus
Nov 07, 2012

irule 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 matched. I don`t need to do a re-direct to another webserver as I do not have one that can send the same message.

 

Have the folowing irule -

 

 

when HTTP_REQUEST {

 

if {[HTTP::uri] contains "/dev"} {

 

pool dev-suite-pool

 

if {[HTTP::uri] contains "/qa"} {

 

pool qa-suite-pool

 

 

} else {

 

*****test message: please use /dev, or /qa or /uat to go to your respective environments"

 

}

 

}

 

 

Please advise?

 

23 Replies