Hi Branden,
There's a lot going on with that iRule. I'd start by making sure you have a OneConnect profile enabled on the virtual server. If you have SNAT enabled on the virtual server, you can use the default OneConnect profile with a /0 source mask. Else, create a custom OneConnect profile with a /32 source mask. If you still see issues with the iRule, try enabling debug and check the output in /var/log/ltm when a failure occurs.
That said, there are a few issues/oddities with the iRule:
1. This condition will never be true as you're setting the URI to lowercase and then checking for a mixed case string:
([string tolower [HTTP::uri]] contains "GISOasis/Login.aspx?Logout=true")
You can replace that whole section with a switch statement to avoid repeating the same [string tolower...] operation on the URI:
Set the node and URL to the value contained in the cookie
switch -glob [string tolower [HTTP::uri]] {
"*mastermenu*" -
"*gisoasis/login.aspx?logout=true*" -
"*oasisaccounting*" -
"*oasisclaims*" -
"*drc[0-9][0-9][0-9][0-9][0-9]* {
2. The iRule combines HTTP payload collection with a stream profile. You should either do one or the other but not both. For payload rewriting only, it's more efficient to just use a stream profile. If you need to insert a cookie based on the payload content, I think you'll need to collect the payload.
3. If the response is a 404, you can just redirect the request and skip the rest of the response logic. So you could move this section to the top of HTTP_RESPONSE and add a return statement to avoid the rest of the code:
when HTTP_RESPONSE {
Check if response is a 404 error code and redirect to gis.grinnellmutual.com if it is
if { [HTTP::status] == 404} {
HTTP::redirect "
https://gis.grinnellmutual.com"
return
}
Aaron