Forum Discussion
andy_22730
Nimbostratus
Dec 19, 2008Use redirect and pools in same iRule?
I'm trying to build one irule that has all my logic in it, it will parse the URI of the request and send some URIs to a pool, but send others to external servers via HTTP::REDIRECT.
...
andy_22730
Nimbostratus
Dec 19, 2008Excellent, this worked. WHat I ended up using:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/blog" } {
pool my-aws-blog-pool
} elseif { [string tolower [HTTP::uri]] starts_with "/a1" } {
HTTP::redirect "http://wwwa1.somwebsite.com/"
} elseif { [string tolower [HTTP::uri]] starts_with "/a2" } {
HTTP::redirect "http://wwwa2.somwebsite.com/"
} else {
HTTP::redirect "http://wwwa1.somwebsite.com/"
}
}
And this does exactly what I want.
My only lingering question now (and I know it's not an irule question but I'll throw it out there) is how to use a DNS name for a node in a pool... I'm lucky that i can get away in this case without using one, but we have servers using virtual names and so I will need to hit an Amazon EC2 server someday using a hostname in a pool.... but thanks the above help, it works.
BTW, that pool is made up of virtual servers in amazon, so far it's working nicely.
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
