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
Apologies, messed up my last post:
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}
}
}
}
And, 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 need to add the pool member port after the member (pool HTTP_pool member 10.10.10.1 80) e.g. video_a (if you haven't already of course).
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
