Forum Discussion
Mike_Conant_598
Nimbostratus
Mar 07, 2005Rules Problem
We just upgraded from 4.2 LB to 4.5.10 HA software on our Dell platform 2650 poweredge. We purchased this upgrade so that we could utilize rules based filtering of traffic based on a certain URI. We h...
bknotwell_12713
Mar 07, 2005Historic F5 Account
I'm not exactly sure why your rule isn't working (though I think you probably want to use the contains operator instead of matches_regex).
I've appended some (sanitized) working 4.x rules that heavily use matches_regex:
load balancing rules
rule a {
if (http_uri contains "/apack/") {
use pool a
}
else {
if (http_uri contains ".cgi") {
use pool acgi
}
else {
use pool ahtml }
}
}
rule b{
if (http_uri contains "/bpack/") {
use pool b
}
else {
if (http_uri contains ".cgi") {
use pool bcgi
}
else {
use pool bhtml
}
}
}
rule c {
if (http_uri matches_regex "\/~()(\/|$)") {
use pool ccgi
}
else {
use pool cnormalcgi
}
}
rule d {
if (http_uri matches_regex "\/~()(\/|$)") {
use pool dhtml
}
else {
use pool dcache
}
}
rule e {
if (http_uri matches_regex "\/~(frobnosticate)(\/|$)") {
use pool ecgi
}
else {
use pool enormalcgi
}
}
rule f {
if (http_uri matches_regex "\/fpack\/") {
use pool f
}
else {
if (http_uri matches_regex "\.cgi") {
if (http_uri matches_regex "^\/~()(\/|$)") {
use pool fcgi
}
else {
use pool fnormal
}
}
else {
if (http_uri matches_regex "^\/~()(\/|$)") {
use pool fhtml
}
else {
use pool fhtmlx
}
}
}
}
rule g {
if (http_uri matches_regex "\/~(cola|lemonlime)(\/|$)") {
use pool g
}
else {
use pool gcgi
}
}
rule h {
if (http_uri matches_regex "^\/(~|%7E)(NON-STOP)(\/|$)") {
use pool hhtml
}
else {
use pool hcache
}
}
rule i {
if (http_uri matches_regex "^/(/|(\./))*ipack/" or http_uri matches_regex "^/(/|(\./))*(~|%7E|%7e).*/ipack(.|..)(bbs|mail|all)/") {
use pool i
}
else {
if (http_uri matches_regex "\.cgi($|\?|/|)") {
use pool icgi
}
else {
use pool ihtml
}
}
}
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
