Forum Discussion
madi_56757
Nimbostratus
Dec 05, 2006dynamic destination conditioned by dns query
hello all,
I have a question regarding my rule.
I get a lot of IPs of my DNS query and i like to forward my traffic to this addresses, or to one of this address, but not without the tes...
Deb_Allen_18
Dec 08, 2006Historic F5 Account
Just realize the HTTP::retry request syntax isn't correct.
Try this instead:
when HTTP_REQUEST {
set request [HTTP::request]
set hostname [getfield [HTTP::host] ":" 1]
log local0. "Uri - [HTTP::uri] Hostname - $hostname Port - [TCP::local_port]"
HTTP::collect
NAME::lookup $hostname
}
when NAME_RESOLVED {
set ip [NAME::response]
log local0. "IP - >$ip<"
if {($ip == "")}{
HTTP::redirect http://host.domain.com/sorry.html
} else {
set index 0
use node [lindex $ip 0] 80
HTTP::release
}
}
when LB_FAILED {
incr index
if {!([lindex $ip $index] =="")}{
use node [lindex $ip $index] 80
HTTP::retry $request
} else {
HTTP::redirect http://host.domain.com/sorry.html
}
}/deb
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
