Thank you kevin for the response, is the below irule will do the URI rewrite , if the browser/client hits the F5 vip with
http://name.domain.com/abc/ten/spa and the backend server should receive with uri rewrite as
http://spa.ten.name.domain.com/abc
On the LTM by doing a curl command it shows that uri rewrite happens , but when we checked HTTP_RESPONSE log and the backend server log, it receives the request as it is ( http://name.domain.com/abc/ten/spa )
did I miss something in the irule ? please advise
when HTTP_REQUEST {
set vip [IP::local_addr]:[TCP::local_port]
set url [HTTP::header Host][HTTP::uri]
set URI [string tolower [HTTP::uri]]
if {[HTTP::uri] contains "/abc/"} {
scan $URI {/%[^/]/%[^/]/%[^/]/} a b c
log local0. $b
log local0. $c
**HTTP::uri "http://$c.$b.name.domain.com/abc/"**
log local0. [HTTP::uri] }
else{
scan $URI {/%[^/]/%[^/]/} a b
log local0. $a
log local0. $b
HTTP::uri "http://$b.$a.name.domain.com/"
log local0. [HTTP::uri]
}
}
when HTTP_RESPONSE {
set client [IP::client_addr]:[TCP::client_port]
set node [IP::server_addr]:[TCP::server_port]
set nodeResp [HTTP::status]
log local0.info "Client: $client -> VIP:$vip$url -> Node: $node with response $nodeResp"
}