Forum Discussion
matt_w_53423
Nimbostratus
Jul 30, 20092 VIPs using the same pool with URI redirection
Can someone please assist me with writing an iRule that will help me direct incoming http/https requests to a specific URI?
I have 2 VIPs (different IPs, no name resolution yet, internal development) using the same pool of servers. The servers host 2 websites with URIs. I want requests coming into VIP 1 going to the 1st URI and requests coming into VIP 2 going to the other URI.
if you need more data, I will glady send this along.
5 Replies
- The_Bhattman
Nimbostratus
take a look at this example
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP__uri.html
Hope this helps
CB - matt_w_53423
Nimbostratus
Are your referring to this example? where "/prefix" is the uri
Make uri path start with /prefix if it doesn't already
when HTTP_REQUEST {
if { not ([HTTP::uri] starts_with "/prefix") } {
HTTP::uri /prefix[HTTP::uri]
}
}
The other example is with two separate pools. I am using the same pool with 2 different VIPs. What i'm trying to achieve is when an http request comes in to the vip it redirects to the URI. The URIs reside on the same pool of servers. Does that make sense? - matt_w_53423
Nimbostratus
and thanks for assisting. - The_Bhattman
Nimbostratus
You could probably redirect it by
HTTP::redirect "http://domain.com/[HTTP::uri]" - matt_w_53423
Nimbostratus
what would the completed iRule look like? thanks
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