mplaksin0
Oct 18, 2022Cirrus
irule uri traffic redirection failing
Hello team,
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".
I tried with ltm policy and have same behavior.
Any one had have any similar case?
mplaksin0First 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 } }