Forum Discussion
Deon
Nimbostratus
Jun 16, 2008BigIP as Proxy for Cross-Domain XMLHttpRequest Calls?
Is it possible to write an iRule that will allow me to rewrite only specific requests and send them along to another server to fulfill a request for data? The essence of what I need to do is in this diagram/page: http://www.yahooapis.com/javascript/howto-proxy.html except I'd like the BigIP to be the proxy instead of the webserver
My web app is already hosted behind a BigIP. When the uri begins with something like "/ImageMetaData", then I would need to send that get off to a server/pool different from the normal one. At this point, the load balance decision will have already been made. Can't permanently change the pool and/or the node for the user.
I've got a skeleton iRule that looks at the uri and finds the matching string, modifies the uri accordingly, changes the host in the header, etc. Not sure where to go from here or if what I am attempting here is even possible or recommended on the BigIP.
Where can I look for examples or a tutorial on how to proceed?
Thanks
-Deon
3 Replies
- Colin_Walker_12Historic F5 AccountWhy don't you post what you've got so far, and we'll see if we have any pointers or suggestions?
It sounds like what you're looking for is very doable.
Colin - Deon
Nimbostratus
Here is what I have so far. Not much actually. I guess I am not completely sure what all needs to be changed or rewritten to do what I am attempting to do.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/ImageMetaData/" }{
log local0. "*********** REQUEST ****************"
log local0. "matched string"
log local0. "host= [HTTP::host]"
log local0. "headernames= [HTTP::header names]"
log local0. "uribefore= [HTTP::uri]"
HTTP::uri "substr [HTTP::uri] 14"
log local0. "uriafter= [substr [HTTP::uri] 14]"
HTTP::header replace Host "172.22.92.28:9095"
log local0. "header Host= [HTTP::header Host]"
log local0. "header Cookie= [HTTP::header Cookie]"
pool DEV_Image_Access_Service
node 172.22.92.28 9095
}
} - spark_86682Historic F5 AccountThat looks somewhat reasonable, though I don't know the ins and outs of XMLHttpRequest. Is it not working for you in some way?
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
