Forum Discussion
H_Sang_39134
Nimbostratus
Jun 11, 2014iRule to detect url and forward port.
Hi,
my main iRule use events HTTP_REQUEST with switch style to detect [HTTP::path] then send to each pool it work properly below is work flow
front https://domain.com/path/ (443) => mid f5 ssl termi...
bhs_114985
Jun 13, 2014Historic F5 Account
Hello,
This shouldn't be any problem at all. Thank you for sharing the architecture it really helps 🙂 Your code is good. Just add the following log statements from my example and you will see the entries in /var/log/ltm.
when HTTP_REQUEST {
log local0. "Http path equals [HTTP::path]"
switch -glob [string tolower [HTTP::path]] {
"/fristpath/_" {
log local0. "http path was [HTTP::path] --> Going to fristpool"
pool fristpool
}
"/secpath/_" {
log local0. "http path was [HTTP::path] --> Going to secpool"
pool secpool
}
"/socket01/*" {
log local0. "http path was [HTTP::path] --> Going to socket01 pool"
pool socket01
}
}
}
I tested most of the common variables of the URL's in your examples. Here is my log output:
/Common/Redirect_Path : http path equals /
/Common/Redirect_Path : http path equals /fristpath
/Common/Redirect_Path : http path equals /fristpath/_
/Common/Redirect_Path : http path was /fristpath/_--> Going to fristpool
/Common/Redirect_Path : http path equals /secpath/
/Common/Redirect_Path : http path equals /secpath
/Common/Redirect_Path : http path equals /secpath/_
/Common/Redirect_Path : http path was /secpath/_--> Going to secpool
/Common/Redirect_Path : http path equals /secpath/_hello
/Common/Redirect_Path : http path equals /secpath/_.hello
/Common/Redirect_Path : http path equals /socket01
/Common/Redirect_Path : http path equals /socket01/
/Common/Redirect_Path : http path was /socket01/ --> Going to socket01 pool
/Common/Redirect_Path : http path equals /socket01/hello
/Common/Redirect_Path : http path was /socket01/hello --> Going to socket01 pool
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