Forum Discussion
The_Bhattman
Aug 31, 2010Nimbostratus
Hi Steve,
What are you asking won't be accomplished without the iRules so I want to apologize upfront but I am going to start throwing you up some iRule code. It sounds like you don't want re-write but you basically want a webproxy
Here is a piece of untested code
However, there are some items you will need to address before hand.
- The ADC must have access to internet
- You must make sure that you have configured the ADC for DNS local lookup as described in SOL5299 located in ask.f5.com (Don't ask me how I remember this stuff 🙂 )
Obviously this is a simple example but my hope at the very least is that it generates ideas in this discussion.
when HTTP_REQUESTED {
if { [HTTP::host] eq "www.yahoo" } {
NAME::lookup www.google.com
Wait until name resolution is completed before sending you to the new page
HTTP::collect
}
}
when NAME_RESOLVED {
set response [NAME::response]
resolved www.google.com to an ip address via load balancer and now use that in the node command.
switch [llength $response] {
0 {
HTTP::respond 500 content "Couldn't Process Request}
default {
HTTP::uri "[HTTP::uri]"
HTTP::header replace "Host" "www.google.com"
node [llindex $response 0] 80
}
}
HTTP::release
}
I hope this helps
Bhattman