Forum Discussion

Colin_17201's avatar
Colin_17201
Icon for Nimbostratus rankNimbostratus
Oct 08, 2008

Help on http redirect on the same server but different service port on suddon URI

May i know whether this can be done

 

Below is the example:

 

 

when http://www.abc.com/aaa will look for http://192.168.0.1:8008 from the LB

 

and http://www.abc.com/bbb will look for http://192.168.0.1:8009 from the LB internally

1 Reply

  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account

    Yes, this can be done. Here is a similar rule that makes a switching/LB decision based on how the URI ends; you would want something that works on the beginning of the URI.

       
       rule image_pool_select {    
        when HTTP_REQUEST {    
          if {[HTTP::uri] ends_with “.gif" } {    
            pool gif_pool    
          } elseif {[HTTP::uri] ends_with ".jpg" } {    
            pool jpg_pool    
        }    
        }    
     

    Have a look at this page:

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

    ...for details and an example.