persist profile with irule

Hi,

I have a virtual server and more than 2 pool. I want to use persistence profile based on pool. I have written irule shown below. Are there any mistakes or advice?

when HTTP_REQUEST {
  switch -glob [string tolower [HTTP::uri]] {
    "/abc*" { 
        pool abc_pool
        persist source_addr

    }
    "/xyz*" { 
        pool pool_xyz
        persist cookie

    }
    "/def*" { 
        pool pool_def
        persist dest_addr
    }

  }
}

Hi,

Looks ok to me, be aware that the default cookie profile will expose the ip addresses of your internal resources to the internet.

Cheers,

Kees

If possible, avoid using the default profile and create a custom profile where you can alter the netmask & timeout values.

Other than that recommendation, looks to be good.