Forum Discussion
Gregt_33960
Nimbostratus
May 22, 2008IRULES to append and Web Server Errors
Hello,
I have found this forum extremely helpful as I learn more about IRules. I have multiple application environments running on pools of webservers. I have to set the F5 to pe...
hoolio
Cirrostratus
May 23, 2008You could also use a switch statement (Click here) to specify the URI and pool based on the requested URI. Note that if the user types http://test.domain.com into the address bar, the browser will append a forward slash, so the URL will be http://test.domain.com/ and the URI will be /.
URI Load Balancing
Desired URI to pool mapping
http://test.domain.com --> user_pool
http://test.domain.com/train --> train_pool
http://test.domain.com/pilot --> pilot_pool
http://test.domain.com/whatif --> whatif_pool
http://test.domain.com/sandbox --> sandbox_pool
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri]"
Update the URI per the mapping above
switch [HTTP::uri] {
"/" {
Request was to root object
log local0. "[IP::client_addr]:[TCP::client_port]: using user_pool"
HTTP::uri "/user/jsp/common/PGlogin.jsp"
pool user_pool
}
"/sandbox" -
"/sandbox/" {
log local0. "[IP::client_addr]:[TCP::client_port]: using sandbox_pool"
HTTP::uri "/sandbox/jsp/common/pgLogin.jsp"
pool sandbox_pool
}
"/train" -
"/train/" {
log local0. "[IP::client_addr]:[TCP::client_port]: using train_pool"
HTTP::uri "/train/jsp/common/pgLogin.jsp"
pool train_pool
}
"/pilot" -
"/pilot/" {
log local0. "[IP::client_addr]:[TCP::client_port]: using pilot_pool"
HTTP::uri "/pilot/jsp/common/pgLogin.jsp"
pool pilot_pool
}
"/whatif" -
"/whatif/" {
log local0. "[IP::client_addr]:[TCP::client_port]: using whatif_pool"
HTTP::uri "/whatif/jsp/common/pgLogin.jsp"
pool whatif_pool
}
default {
Take some default action?
}
}
}
Aaron
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