Forum Discussion

mambrose_57200's avatar
mambrose_57200
Icon for Nimbostratus rankNimbostratus
Nov 28, 2008

rewrite between pools

I need to create a rule to redirect traffic for static files from the appserver pool to a library pool. I've tried this with no luck.

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] starts_with "/strin1" } {

 

pool library_pool

 

} elseif { [HTTP::uri] starts_with "/string2" } {

 

pool library_pool

 

}

 

}

 

 

Does anyone have some suggestions?

 

 

Thanks

1 Reply

  • Your syntax looks fine. If the URI doesn't match either of those two strings it should fall out to whatever is defined as the default pool on the virtual server. You might try adding some logging to see why it's not matching (not sure exactly what behavior you are seeing when you say you've tried it with "no luck").

    The logs go by default into /var/log/ltm.

     
     when HTTP_REQUEST { 
     if { [HTTP::uri] starts_with "/strin1" } { 
        log local0. "Matched string1" 
        pool library_pool 
     } elseif { [HTTP::uri] starts_with "/string2" } { 
        log local0. "Matched string2" 
        pool library_pool 
     } else { 
        log local0. "Didn't match either string" 
     } 
     }  
     

    Denny