Forum Discussion

BDunbar_8799's avatar
BDunbar_8799
Icon for Nimbostratus rankNimbostratus
Feb 24, 2011

URL Forward with a POST change

Got a ping from one of our technical project managers - he wanted to know if the F5 LTM could do URL forwarding, with a twist.

 

 

'Do you know if the F5 can do URL forwarding service, can easily be updated via HTTP POST or similar method? We've got (redacted) that changes it's URL fairly often, need to have an unchanging URL that refers to the changing URL, have the change from one to the next happen automatically.'

 

 

I know there are URL forwarding services, but digging up one that allows an update automatically was a bit of a poser. And if we can do it with the F5 and bring it in house, that would be super-keen.

 

  • If I understand the scenario, I think you can do something like this with an iRule.

     

     

    Do you want to present one URL externally but have the hostname and/or URI changed based on some backend web application's changes? Would you want to load balance the destination host(s) by IP address or hostname? Can you provide psuedo code of the logic you'd like to implement?

     

     

    What kind of client would update the iRule configuration? Can it make SOAP requests to an LTM self or management IP? If so, you could use the iControl API to update a datagroup that the iRule reads for configuration. See this page for details on iControl: http://devcentral.f5.com/wiki/default.aspx/iControl.HomePage

     

     

    Aaron
  • Do you want to present one URL externally but have the hostname and/or URI changed based on some backend web application's changes?

     

     

    One URL externally, the URL (URI?) that the traffic is sent to would change.

     

     

    Load balancing is not in the scenario - it's assumed the destination will handle that.

     

     

    What kind of client would update the iRule configuration? Can it make SOAP requests to an LTM self or management IP?

     

     

    This is a very generalized deal, based on a few minutes of drive-by conversation asking about what-ifs for a service that is itself an airy notion in the PM's office. So .. sure: anything is possible at this point.

     

     

    Pseudo code of the logic - I'll take a whack at it.

     

     

    Setup: several clusters of application servers: service1, service2, service3. A black box device that sends traffic from 'a' URL to any of three URLs, and can change which one that is without a person poking around in the interface, i.e. real fast and automated. The black box doesn't know or care about host names, just the URL of it's destination.

     

     

    1. User POV

     

    Alice clicks a link in her browser: service.organization.com

     

     

    The Black Box that responds to that IP looks up what URL it should send that traffic to: service1.organization.com

     

     

    Alice's browser launches the application that lives at service1.organization.com

     

     

    2. IT POV

     

    The watchdog process that monitors 'service*.organization.com' realizes that the cluster that is service1 needs to be taken offline, and service2 brought up in it's place. It sends request to Black Box 'change destination from service1 to service2.

     

     

    3. User POV

     

    Alice comes back later, clicks service.organization.com and is routed to service2.organization.com.
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    If this is going to be based solely on which applications are online at any given time, this actually gets much easier. You could set up monitors on each of the servers along with some simple iRule logic. If server1 is up, send request to service1.org.com, else if server 2 is up, send request to service2.org.com, etc.

     

     

    If that's what you're looking for , then it's actually relatively simple. If you're looking for something more dynamic and based off of things that aren't simple to monitor, like a pool member being up or down, then it gets more interesting. ;)

     

     

    Colin
  • Joe/Colin discuss in Post of the Week: http://devcentral.f5.com/weblogs/dctv/archive/2011/02/25/post-of-the-week-dynamic-url-forwarding.aspx Click Here