Forum Discussion
Eugene_Reznik_1
Nimbostratus
Jul 31, 2013Routing based on URI
I need to create an iRule that would send all traffic to the root of website and and about 100 defined subfolders to the default pool. Any undefined subfolders should go to the market pool.
Here...
nitass
Employee
Aug 01, 2013Would you be able to provide an example?there is example in class wiki. anyway, this is mine.
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { [class match -- $uri starts_with uri_class] } {
pool foo
} else {
pool qux
}
}
when HTTP_RESPONSE {
log local0. "uri: $uri pool: [LB::server pool]"
}
}
[root@ve10:Active] config b class uri_class list
class uri_class {
{
"/uri1/"
"/uri2/"
"/uri3/"
}
}
[root@ve10:Active] config cat /var/log/ltm
Aug 1 11:55:34 local/tmm info tmm[5139]: Rule myrule : uri: /uri1/something pool: foo
Aug 1 11:55:45 local/tmm info tmm[5139]: Rule myrule : uri: /somethingelse pool: qux
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