Forum Discussion
chungyu_16122
Jul 21, 2011Altostratus
Refine iRule with external class file
I have created an iRule where I pick which servers are used based off URI. IE. if www.mysite.ca/principal go to webnode and if www.mysite.ca/it go to drupal.
One thing I am having trouble w...
chungyu_16122
Jul 28, 2011Altostratus
Thanks guys
we have refined the rule a bit , this works for the most part but I need to maintain 2 list, one for webnode and one for drupal nodes.
when HTTP_REQUEST {
if {[matchclass [HTTP::uri] starts_with $::WPS]}{
log local0. "Requested URL starts with [HTTP::uri], directing to pool WEBNODE"
pool WEBNODE
}
elseif {[matchclass [HTTP::uri] starts_with $::DRUPALSITES]}{
log local0. "Requested URL starts with [HTTP::uri], directing to pool DRUPAL"
pool DRUPAL
}
else {
log local0. "Requested URL does not match any class: [HTTP::uri], defaulting to pool WEBNODE"
pool WEBNODE
}
}
However, one of the developers is working on this iRule but it still not working.
when HTTP_REQUEST {
set SITE [lindex [split HTTP::uri "/"] 1]
log local0. "Requested site: $SITE"
if {[matchclass $SITE equals $::WPS]}{
log local0. "Requested URL starts with [HTTP::uri], directing to pool WEBNODE"
pool WEBNODE
}
elseif {[matchclass $SITE equals $::DRUPALSITES]}{
log local0. "Requested URL starts with [HTTP::uri], directing to pool DRUPAL"
pool DRUPAL
}
else {
log local0. "Requested URL does not match any class: [HTTP::uri], defaulting to pool WEBNODE"
pool WEBNODE
}
}
I did follow your post and found some interesting info which may us help refine this even more.
Chung
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