Forum Discussion

GeoIT_32223's avatar
GeoIT_32223
Icon for Nimbostratus rankNimbostratus
Jul 18, 2014

iRule seems to be causing connection to be reset

I have created this iRule which works for the first "test_url" but seems to send a reset when using the "main_url"

Basically what I am trying to do is first insert a session cookie if the "test_url" is used then redirect users to a certain page if they try accessing any URIs in my DataGroup.

Thoughts?

when HTTP_REQUEST {

  if {[HTTP::host] equals "test_url} {
            set cookie 0
            HTTP::redirect "https://main_url"

       }
  if { [class match [string tolower [HTTP::uri]] starts_with BlockedURL]  and [HTTP::cookie exists "VPNUSER"]} {
                    HTTP::redirect "http://www.google.com"
                }

      }

            when HTTP_RESPONSE {

        if { $cookie eq 0 and !( [HTTP::cookie exists "VPNUSER"] )} {
                HTTP::cookie insert name "VPNUSER" value "UHSVPNUSER"
            }

        }
  • Hi GeoIT,

     

    Have you put in log statements to validate that it's hit hitting the logic of the iRule as you had expected?

     

    -=Bhattman=-