Forum Discussion
hooleylist
Nov 19, 2008Cirrostratus
Requests for extensions which are defined in the forward list should not be redirected. So the .jpg request should make it to the pool without the full filename/path being defined in the forward list.
You could add some logging to the iRule, test and then check the /var/log/ltm log file. Here is a sample of the logging you could use:
when RULE_INIT {
set ::ForwardList [list / .html .htm .asp .pl .jpg .css .jsp .gif]
}
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: New request to [HTTP::uri] (path: [HTTP::path])."
if { ([string tolower [HTTP::uri]] starts_with "/knav/nav") or
([string tolower [HTTP::uri]] starts_with "/") or
([matchclass [HTTP::path] ends_with $::ForwardList]) } {
log local0. "[IP::client_addr]:[TCP::client_port]: Matched logic to skip redirects."
return
} else {
switch -glob [string tolower [HTTP::uri]] {
"/dsc*" {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::path] matched /dsc*."
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002958"
}
"/kantech*" {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::path] matched /kantech*."
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002735"
}
...
}
}
}
Aaron