Forum Discussion
nathe
Sep 23, 2012Cirrocumulus
tqu
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