Forum Discussion

matt_w_53423's avatar
matt_w_53423
Icon for Nimbostratus rankNimbostratus
Jul 30, 2009

2 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

  • take a look at this example

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP__uri.html

     

     

    Hope this helps

     

     

    CB

     

  • 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?

     

  • You could probably redirect it by

     

     

    HTTP::redirect "http://domain.com/[HTTP::uri]"