Jump to content
Welcome to our new Citrix community!

iRules Conversion to Netscaler


Sudhir Bhagat

Recommended Posts

Hi Friends, 

 

I need help to convert F5 iRules to Netscaler.  Referred the Citrix iRule conversion documents but able to convert some of the iRules only. for few require help here.

 

iRule # 1: -

 

when HTTP_REQUEST {
  # save hostname for use in response
  set fqdn_name [HTTP::host]
}
when HTTP_RESPONSE {
  if { [HTTP::is_redirect] }{
    if { [HTTP::header Location] starts_with "/" }{
      HTTP::header replace Location "https://$fqdn_name[HTTP::header Location]"
    } else {
      HTTP::header replace Location "[string map {{http://} {https://}} [HTTP::header Location]]"
    }
  }
}

 

_______________________________

 

iRule # 2 

 


when HTTP_REQUEST {
  HTTP::respond 301 "Location" "https://[HTTP::host][HTTP::uri]"
}

 

_________________________________

 

iRule#3

 

when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] equals "join.123.com" } {
        HTTP::respond 301 Location "https://www.abc.com/hins/quote/"
    }
}
 

___________________________

 

iRule#4

 

when HTTP_REQUEST {
        set app_pool [class match -value -- [string tolower [HTTP::uri]] starts_with services_class]
        if {$app_pool ne ""} {
            pool $app_pool
        } else {
          pool prod_poola
        }
    }

 

I do have some more iRules, will share,

 

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...