Forum Discussion

Chad_Young_1032's avatar
Chad_Young_1032
Icon for Nimbostratus rankNimbostratus
Mar 12, 2008

redirect external URL based on Pool member health

I am trying to create a iRule that will first check the health of a pool and then redirect the request to an external host based on pool availability. I have a need not to proxy the request, so I can't redirect to a LTM VIP or pool. I am trying to redirect to an external host. But I still need the utilize the LTM to base the decision of which URL to redirect to based on pool member availability.

 

 

Example:

 

user enters www.abc.com

 

 

iRule determines:

 

Pool A available then redirect to www.123.com

 

Pool A not available then redirect to www.456.com

 

 

Any help would be greatly appreciated!

2 Replies

  • you can do that:

     

     

    when HTTP_REQUEST {

     

    if {[active_members poolA] > 0} {

     

    HTTP::redirect www.123.com

     

    } else {

     

    HTTP::redirect www.456.com

     

    }

     

    }

     

     

    OR you can do the following:

     

     

    when HTTP_REQUEST {

     

    HTTP::redirect www.123.com

     

    }

     

     

    in your HTTP profile you specify a fallback host to be www.456.com.

     

     

    The default pool of your VS will be poolA

     

     

    This way if at least one pool member in poolA is available then this iRule will be executed and the the user will be redirect to www.123.com

     

     

    fallback host in http profile specify a redirect to do in case all pool members are down

     

     

    HTH