Forum Discussion
tqu_93931
Nimbostratus
Sep 23, 2012Direct HTTP request from an IP to specific pool members
We have an iRule works OK as below. HTTP requests are directed to coresponding pools respectively according to URI.
Rule_1:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
...
nathe
Cirrocumulus
Sep 24, 2012tqu
Thought I'd repost back with my 1 iRule for this:
when HTTP_REQUEST {
if { [HTTP::header "True-Client-IP"] equals "1.2.3.4"} {
log local0. "Requests from 1.2.3.4"
switch -glob [HTTP::uri] {
"/video/*" { pool VIDEO member video_a}
"/audio/*" {pool AUDIO member audio_a}
"/text/*" {pool TEXT member text_a}
default {pool default_pool member default_a}
}
} else {
switch -glob [HTTP::uri] {
"/video/*" { pool VIDEO }
"/audio/*" {pool AUDIO}
"/text/*" {pool TEXT}
default {pool default_pool}
}
}
}
Also, according to https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/130/iRules-101--05--Selecting-Pools-Pool-Members-and-Nodes.aspx
You can also choose a specific pool member using the pool command:
pool HTTP_pool member 10.10.10.1 80
So if you haven't you may bee to add the port number after video_a etc..
Hope this helps,
N
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
