Emre_27149
May 09, 2011Nimbostratus
irule redirection issue
Hi,
Incoming client requests to http://xyz.com.tr - (10.x.x.199) distrubutes to the pool httpgw-8086-pool but I want to change the URI when the clinet requests load balanced (exmp: 10.x.x.257:8086/httpgw) . I have wrote the below irules to accomplish my goal but it did not work.How can I direct the client requests to the pool as . Thank you."
pool httpgw-8086-pool {
monitor all tcp
members {
10.x.x.157:8086 {}
10.x.x.158:8086 {
session user disabled
}
}
rule httpgw-irule {
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/" } {
HTTP::uri [string map -nocase {"/" "/httpgw"} [HTTP::uri]]
}
}
}
rule httpgw-irule-alternate {
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" }
{ set newuri "/httpgw"
log "Incoming uri - [HTTP::uri] being translated to $newuri"
HTTP::uri $newuri
}
}
}
rule httpgw-redirection {
when HTTP_REQUEST {
if { (([HTTP::host] equals "xyz.com.tr") and ([HTTP::uri] equals "/")) }{
HTTP::redirect "http://xyz.com.tr/httpgw"
}
}
}
virtual httpgw-8086-VIP {
pool httpgw-8086-pool
destination 10.x.x.199:http
ip protocol tcp
rules httpgw-irule-alternate
persist source_addr
profiles {
http {}
tcp-lan-optimized {
clientside
} tcp-wan-optimized {
serverside
}
}
}