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 23, 2012tqu
I'd either combine the 2 irules into 1 or due to the fact that it's the same event then you may want to use a priority to double ensure the irule no.2 fires the http_request event first
priority 100
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/video/*" { pool VIDEO }
"/audio/*" {pool AUDIO}
"/text/*" {pool TEXT}
default {pool default_pool}
}
}
priority 10
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}
}
}
}
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
