Forum Discussion
dusten_25233
Nimbostratus
Oct 23, 2008Fallback 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;
}
}
}
- hoolio
Cirrostratus
Hi there,when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0}{ if {not ([HTTP::path] starts_with "/maintenance_files/"} { HTTP::uri "/maintenance_files/index.html" } pool dmz-stage2 } I shall be the new uber global redirector switch -glob [HTTP::uri] { "/gift*" - "/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 [HTTP::path] { "/feed" - "/feed/" { HTTP::uri "/gift/index.php?gg_id=$id&sec=feed&[HTTP::query]" } "/email" 0 "/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; } } }
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