Forum Discussion
Steve_87232
Nimbostratus
Aug 30, 2010ProxyPass - Reverse Proxy / Backend URL rewrite.
I have been trying to allow a user to type (for example) www.google.com in their browser, that then is sent to a virtual server on the LTM that sends the request to www.yahoo.com. The user sees the co...
The_Bhattman
Nimbostratus
Aug 31, 2010Hi 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
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