Forum Discussion
Leonjsr_323498
Nimbostratus
Jun 09, 2017iRule Question
Hi I created an rule to send traffic to sub.domain.com to a particular node 1.1.1.1 and that works fine. But I need any other traffic either destined to the same domain name, domain.com to go to ...
cjunior
Nacreous
Jun 09, 2017Hello, I'm not sure when you haven't a host header, so Is this what your are trying to do?
when HTTP_REQUEST {
if { [getfield [HTTP::host] ":" 1] ends_with "sub.domain.com" } {
snatpool SNAT
node 1.1.1.1 80
}
elseif { [HTTP::host] contains "domain.com" || [HTTP::path] contains "domain.com" } {
snatpool SNAT
node 1.1.1.2 80
}
}
Test 1:
GET /path1/page HTTP/1.1
Host: www.sub.domain.com
Connection: close
Test 2:
GET /path1/page HTTP/1.1
Host: www.domain.com
Connection: close
Test 3:
GET http://www.domain.com/path1/page HTTP/1.0
Regards
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
