Forum Discussion
JG
Jul 20, 2018Cumulonimbus
Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] starts_with "/review2"} {
HTTP::path [string map { "/review2" "/review" } [HTTP::path]]
pool pool_2
} else {
pool pool_1
}
}
when HTTP_RESPONSE {
if { [class match [IP::server_addr] equals private_net] } {
if { [HTTP::header exists "Location"] } {
HTTP::header replace Location [string map { "/review/" "/review2/" } [HTTP::header Location]]
}
STREAM::expression {@/review/@/review2/@}
STREAM::enable
} else {
STREAM::disable
}
}
when STREAM_MATCHED {
STREAM::replace
log local0. "String matched and replaced."
}
.