Here's what I'm trying to do. I send a request to pool A. If and only if pool A returns a 404 code, I need to rewrite the path and send the request to pool B. No matter what pool B responds with, return it to the client.
So, in the HTTP_REQUEST section, we save off the [HTTP::path] into the variable $mypath. In the HTTP_RESPONSE section, we have:
when HTTP_RESPONSE {
if { $::DEBUG }{
log "respcode -> [HTTP::status]'"
log "host -> [HTTP::host]"
}
if { ([HTTP::status] == 404) } {
if { $mypath ends_with "/" }{
set mypath [string range 0 [string length $mypath]-1 $mypath]
append .html $mypath
}
HTTP::path $mypath
if { $::DEBUG }{
log "retruri -> $mypath"
}
pool B
}
}
The problem comes in the line
HTTP::path $mypath
THe error is:
01070151:3: Rule [myrule] error: line 34: [command is not valid in current event context (HTTP_RESPONSE)] [HTTP::path $mypath]
How can I change the path/uri so I can submit a request to pool B without forcing a redirect?
Tom