Forum Discussion

obelix_53086's avatar
obelix_53086
Icon for Nimbostratus rankNimbostratus
Sep 21, 2009

pool member specific page

Hello,

 

 

Is there any way or is it possible to specify a specific page within a pool a rule can goto

 

 

"/accounts/*" {

 

stick /accounts/ sites to test server

 

pool www.migration member 132.234.242.43:80

 

}

 

 

can I specify a specirfic page here?

 

 

 

thanks

 

 

  • Yes - use [HTTP::uri]. From the iRules wiki:

     
     when HTTP_REQUEST { 
       if { [HTTP::uri] ends_with "cgi" } { 
          pool cgi_pool 
       } elseif { [HTTP::uri] starts_with "/abc" } { 
          pool abc_servers 
      } 
     } 
     

    HTH,

    Matt
  • You can use the SWITCH as well

    Here are some additional examples

     
     when HTTP_REQUEST {  
       switch -glob [HTTP::uri] { 
       "/accounts/*" { pool www.migration member 132.234.242.43:80 } 
       } 
     } 
     

    or

     
     when HTTP_REQUEST {  
       switch -glob [HTTP::uri] { 
       "*cgi" { pool cgi-pool } 
        "/abc*" { pool abc_servers } 
        default { pool default_pool } 
       } 
     } 
     

    Hope this helps

    CB

  • thought that would be the case... though I was hoping that it could redirect to a specific url like

     

     

    "/accounts/*" {

     

    stick /accounts/ sites to test server

     

    pool www.migration member 132.234.242.43/accounts/:80

     

    }