Help required to construct Irule for Source based Http redirection
Hi Team,
I need a help to construct the Irule for the following requirement.
We have a application called finance running in 2 different servers located on different location.
Site A: https://site1.xyz.com/finance/home/?locale=en_uk
Site B: https://site2.xyz.com/finance/home/?locale=en_uk
Now customer want to create a common VIP for both the sites with following requirements.
Users from 192.168.53.x/24 should always reach site A Users from 192.168.1.x/21 and 192.168.16.x/21 should always reach site B Any users other than this subnet should reach any of the available members.
I created the site like this:
Virtual server: Finanace_VIP 192.168.223.1:443 Pool: Finance_Pool Pool members: SiteA:443 SiteB:443 HealthMonitor Https
Irule:
when HTTP_REQUEST { if {([active_members Finance_Pool] == 1) and ([IP::addr [IP::client_addr] equals 192.168.53.x/24]) } { HTTP::redirect "https://site1.xyz.com/finance/home/?locale=en_uk"; } else if {([active_members Finance_Pool] == 1) and ([IP::addr [IP::client_addr] equals 192.168.1.x/21 or ([IP::addr [IP::client_addr] equals 192.168.16.x/21]) }
{ HTTP::redirect "https://site2.xyz.com/finance/home/?locale=en_uk"; } else { pool finance_pool }
}
Will this help to fulfill my requirement. Please provide suggestion to implement this successfully.