I have to implement an irule to redirect traffic based on URL.
So i made following code:
when HTTP_REQUEST { if { [HTTP::uri] starts_with “/specialurl” } {
snatpool /NAT_Outside
pool /Apps_pool
log local0. “[IP::client_addr] Ingreso a [HTTP::uri]” } }
The irule works fine, but the owner of the application says that when the app (programed in ajax) call’s another uri of the website, the service get stucked in the pool “/App_pool”.
The gateway of VM of default pool its this bipip and App_Pool its the ip of virtual-server of other bigip that its in other point of the network (we reach it via routing).
I attach the list.
I tried a policy that says “if the uri contains /specialurl foward traffic to pool App_Pool” and same behavior.
Maybe i can try to set default pool as App_Pool and use a policy with "not contains /specialurl foward traffic to pool GOL (default)
Let me see its this is ok. I have no access to the specialurl bigip. It owned by other team. The irule its no applied at this time, but it was yesterday in virtual GOL.
ltm pool /apps_pool {
members {
/VS_OUTSIDE_F5:https {
address x.x.x..x%12 <--- This ip its from bigip that i have no access.
session monitor-enabled
state up
}
}
monitor gateway_icmp
partition Proyectos
}
@mplaksin0 First I would create a /32 netmask OneConnect profile and associate it with the virtual server in question. After you have done that use the following iRule configuration replacing whatever you might want to match in the if statement but leave everything else and that should solve your issue.
when CLIENT_ACCEPTED {
set DEFAULT_POOL [LB::server pool]
}
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/specialurl" } {
snatpool NAT_Outside
pool Apps_pool
log local0. "[IP::client_addr] Ingreso a [HTTP::uri]"
} else {
pool $DEFAULT_POOL
}
}
I did a similar configuration, and it is true it works correctly. In the VS use as default pool App_Pool. In the Irule, indicate that if it “does not contain” /app_pool, redirect to the default pool and it started to work.