Forum Discussion

Eddie_27920's avatar
Eddie_27920
Icon for Nimbostratus rankNimbostratus
Feb 05, 2009

iRule for 2 urls to same pool but different websites

OK so I'm very VERY new to this iRule stuff. We really haven't used our LTMs for much more than load balancing. What I'm looking for is a way to have lets say... www.abc.gov to a particular VIP with a pool os ISA servers and www.def.gov to the same VIP with the same ISA servers. These ISA servers will be publishing the 2 different websites. Is this possible?

 

 

My reason for this is that I'mlearning about iRules for if a url is something to send it to a certain pool, but that does not help with the amount of pools used on that contain the same nodes. Remember that the nodes are ISA publishing websites to the public.

 

Thanks,

 

Eddie
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Eddie,

    It sounds like all of the ISA servers answer for all of the web applications by parsing the Host header in the requests. If so, you could just create a single VIP pointing to a single pool containing all of the ISA servers. LTM will load balance the requests irrespective of which app the request is for.

    If you do need to split out the requests to a specific pool based on the Host header, you can use HTTP classes (in 9.4 and higher) or a fairly simple iRule:

     
     when HTTP_REQUEST { 
      
         Check the requested host header 
        switch [string tolower [HTTP::host]]{ 
           "site1.example.com" { 
              pool site1_pool 
           } 
           "site2.example.com" { 
              pool site2_pool 
           } 
           default { 
              pool default_pool 
           } 
        } 
     } 
     

    Aaron
  • Hi Aaron, thanks for the quick reply.

     

    OK but that still requires me to use 2 different pools to the same 2 ISA servers just because they will be 2 different web sites, right?

     

    I was wondering if an iRule can help me use the same VIP, same POOL, but look at the header, like a the pool level, to send the request to the proper hosted website.

     

    In your iRule example it still uses 2 different pools and I was trying to see about conserving IP addresses.

     

    Gotta tell ya I'm getting pretty excited about this iRules stuff, too bad they never sent me to training and we haven't used them to date.

     

    Eddie
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Eddie,

     

     

    I was just suggesting that you have the option to use an iRule and two pools if only some of the ISA servers answer for specific sites. If the ISA servers answer for both sites, then you don't need an iRule--just one VIP and one pool for both sites.

     

     

    I assume this is HTTP only. If it's HTTPS you would either need a wildcard cert valid for both FQDN's, a cert which uses Subject Alternate Names and is valid for both FQDNS, or a separate VIP per web site.

     

     

    Aaron