Tony2020
Aug 30, 2018Nimbostratus
Redirect to pool based on URI not working
Hi All,
I am having issues with a redirect within an Irule.
Here is what I am trying to do.
-
If users coming from the internet (not matching datagroup 10.0.0.0/8) and they go to "/test" they should continue to get forwarded to the servers in the "TESTPOOL" without issues. However if they go to the main site or any other URI not matching this, they should get redirected to the maintenance page. ** This is not working -- they get redirected to maintenance page regardless if they put in the /test URI or not ***
- If users coming from the internal network matching the data group (10.0.0.0/8), they should be sent to the servers in the pool regardless the URI or what they are trying to access...This is working...
Can anyone let me know what I am missing where external users going to "/test" URI should get processed?
Thanks for the help!
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/test" {
pool TESTPOOL_443
}
}
if {([class match [IP::client_addr] equals DG-INTERNAL-IP])} {
pool TESTPOOL_443
} else {
HTTP::redirect "http://maintenance.test.com"
}
}