The iRules to NetScaler conversion guides take you through the process of converting your F5 iRules into policies on NetScaler. If you have been using iRules and would like to create the same functionality on NetScaler these guides simplify the process and gets you up and running faster.
This is general use case for redirecting HTTP based requests to HTTPS with exception to certain domains. The exceptions should be processed by the vserver where the request lands.
when CLIENT_ACCEPTED { |
Source - https://devcentral.f5.com/questions/referencing-the-vs-default-pool-as-destination-in-irule
add patset allowed_hosts bind patset allowed_hosts www.domain-a.de bind patset allowed_hosts www.domain-b.de bind patset allowed_hosts www.domain-c.de add responder action act_redirect_others redirect '"https://"+HTTP.REQ.HEADER("Host")+HTTP.REQ.URL' add responder policy pol_redirect_others HTTP.REQ.HEADER("Host").EQUALS_ANY("allowed_hosts").NOT act_redirect_others |
Bind Responder policy to specific VSERVER or to Global responder bind point. Here we are creating the exception list using patset and any of the requests with matching Host header will be allowed to be processed on specific vserver. While all other requests will be redirected with protocol changed to https.