Forum Discussion
Kai_Wilke
Feb 26, 2016MVP
Hi Tatmotiv,
you may try to use the HTTP_REQUEST_SEND event. This event will trigger after LB_SELECTED has choosen the member and also on every subsequent HTTP request...
when HTTP_REQUEST_SEND {
clientside {
if { [HTTP::uri] starts_with "/abc/" } {
if { [LB::server port] equals 8001 } {
HTTP::uri "/def[string range [HTTP::uri] 4 end]"
}
elseif { [LB::server port] equals 8002 } {
HTTP::uri "/ghi[string range [HTTP::uri] 4 end]"
}
}
}
}
Note: I've changed your code to use [string range] command in combination with substitution. Its much more stable and also performant to just cut/add the leading portion that needs to become replaced. You may have to change the 4 to the length of the string that needs to become cutted.
Cheers, Kai