Forum Discussion
irule redirection
I have the below VIP, pool and some alternative
irule to successful my goal.
İncoming
requests to http://xyz.com.tr/httpgw
(10.x.x.199) distrubutes
to the
pool httpgw-8086-pool but the URI
need to change as 10.x.x.257:8086/httpgw when
the requests disturubuted the pool httpgw-8086-pool. I have wrote the below
irulus to accomplish my goal but is did not work.so what kind of change I need to
perform on the irule to accomplish my goal. 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
}
}
}
- Emre_27149Nimbostratus
Hi,
- hooleylistCirrostratusMichael replied here:
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com