Forum Discussion

Drew_123833's avatar
Drew_123833
Icon for Nimbostratus rankNimbostratus
Sep 16, 2013

Exclude subfolder from loadbalancing

Goodafternoon folks

 

How can I exclude a subfolder from loadbalancing?

 

Website: testsite.com (just example, because website is not public available) Adminmodule: testsite.com/admin/login.aspx System: LTM BigIP

 

Server: IIS Sites: the website testsite.com is now loadbalanced in a pool with 2 servers, this is already working. The .../admin/login.aspx subsite can not be loadbalanced. We can only have 1 admin module on a server. Is there a way to exclude this?

 

Thx a lot.

 

Drew

 

5 Replies

  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account

    you can do something like this. Note I used contains as it looks like that was not the full uri. If you have the full URI you can use equals.

     

    when HTTP_REQUEST { if { [HTTP::uri] contains "/admin/login/aspx" } { node } }

     

  • RickM's avatar
    RickM
    Icon for Nimbostratus rankNimbostratus

    I have 4 pools, 2 are set up for round-robin, the other 2 have the same servers but use priority activation so only one is active at a time. This wiki markup is killing me, I don't have the patience for this junk today...

    IRULE

    Select non-loadbalanced pool or loadbalanced pool
    when HTTP_REQUEST {
       if { [string tolower [HTTP::path]] starts_with "/path-not-loadbalanced/" } {
    select proper non-loadbalanced pool
        if { [TCP::local_port] equals "443" } {
            pool nlb-https
    }   else {
        pool nlb-http
    }
    }   else {
     select load balanced pool
    
    if { [TCP::local_port] equals "443" } {
            pool lb-https
    } else {
        pool lb-http
    }}}
    
  • Hello Richard

    Thx for your reply. For now it seems to work, here is the irule

         when HTTP_REQUEST {
    
            if   {[HTTP::uri] contains "/admin/login.aspx"} {
             node 192.168.1.20
    
            } else {pool magic_pool}
         }
    
  • Rickmmcl, you're on the right track I think, but you need to enable or disable a server SSL profile if you're going between HTTP and HTTPS pools. Add a server SSL profile to your VIP and an iRule like this:

    when HTTP_REQUEST {
        if { [string tolower [HTTP::path]] starts_with "/path-not-loadbalanced/" } {
            select proper non-loadbalanced pool
            if { [TCP::local_port] equals "443" } {
                pool nlb-https
            } else {
                pool nlb-http
                SSL::disable serverside
            }
        } else {
             select load balanced pool
            if { [TCP::local_port] equals "443" } {
                pool lb-https
            } else {
                pool lb-http
                SSL::disable serverside
            }
        }
    }
    

    And you should probably add a OneConnect profile as well.

  • I had some problems that we couldn't always login on the admin subsite. When we reached load balancer 1, the user was not be able to logon. This solved the problem:

    when HTTP_REQUEST {
    
            if   {[HTTP::uri] contains "/admin/*"} {
             node 192.168.1.20 80
    
            } else {pool magic_pool}
         }