通过F5 LTM iRule实现根据URL进行流量分发

方法:在iRules添加

when HTTP_REQUEST {
  if { [HTTP::host] eq "www.xxx.com" } {
  if { ([HTTP::uri] starts_with "/index.php") or ([HTTP::uri] starts_with "/?question/") or ([HTTP::uri] starts_with "/SMOEIF") or ([HTTP::uri] starts_with "/viewunite") or ([HTTP::uri] starts_with "/viewunite2") or ([HTTP::uri] starts_with "/bossjb") or ([HTTP::uri] starts_with "/serviceinter") or ([HTTP::uri] starts_with "/mktuni") or ([HTTP::uri] starts_with "/serviceb") or ([HTTP::uri] starts_with "/k968888") } {
     pool www.xxx.com
  } else {
     pool www.xxx.com_new

 }
}}

或者把or更改成||也是可以的

when HTTP_REQUEST {

  if { [HTTP::host] eq "www.xxx.com" } {

  if { ([HTTP::uri] starts_with "/index.php") || ([HTTP::uri] starts_with "/?question/")} {

     pool www.xxx.com

  } else {

     pool www.xxx.com_new

 }

}

}


你可能感兴趣的:(LTM,通过F5)