dusten_25233
Oct 23, 2008Nimbostratus
Fallback Pool with URI redirect.
Hi All,
So I have a question. I would like a fallback pool so that if there are no member in the active pool it uses the fallback and directs all traffic to one uri. Here is what I have so far any suggestions would be helpful.
Thanks
when HTTP_REQUEST {
if { [active_members [LB::server pool]] == 0 } {
HTTP::uri "/index.html"
pool dmz-stage2
}
I shall be the new uber global redirector
switch -regexp [HTTP::uri] {
"^/gift/?" {
set id ""
let's get the last numeric element of the uri
regexp {\d+$} [HTTP::path] id
this if is probably not needed anymore seeing as how we hardcode id
if { $id ne "" } {
are we special email or feeds...
switch -regexp [HTTP::path] {
"/feed/?" {
HTTP::uri "/gift/index.php?gg_id=$id&sec=feed&[HTTP::query]"
}
"/email/?" {
HTTP::uri "/gift/index.php?gg_id=$id&sec=email&[HTTP::query]"
}
default {
HTTP::uri "/gift/index.php?gg_id=$id&[HTTP::query]"
}
}
}
use pool dmz-stage;
}
default {
pool dmz-stage;
}
}
}