Forum Discussion
Qasim
Cirrostratus
Aug 28, 2019URL PATH based routing
Hi, wondering if someone can help me here with a basic IRule that routes traffic to a particular pool based on matching a FQDN and URL path? The reason for this is that the same FQDN is used ...
Qasim
Cirrostratus
Aug 28, 2019Hi,
Apologies it was my bad. I was making a typo i the rule. so what's your though about the below:
what would my Irule look like if I was to merge the following two Irules into one:
- when HTTP_REQUEST {
- switch [HTTP::host] {
- "abc.com"
- {
- switch -glob [HTTP::uri] {
- "/abc.svc" { pool abc_pool }
- }
- }
- }
- }
- when HTTP_REQUEST {
- switch [HTTP::host] {
- "efg.com"
- {
- switch -glob [HTTP::uri] {
- "/efg.svc" { pool efg_pool }
- }
- }
- }
- }
in the above two rules the fqdn is different as well
Snl
Cirrostratus
Aug 28, 2019try below
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "abc.com" and [HTTP::uri] contains "/abc.svc" } {
pool abc_pool
return
if { [string tolower [HTTP::host]] eq "xyz.com" and [HTTP::uri] contains "/efg.svc" } {
pool xyz_pool
return
}
}
}
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