Product Documentation

Configuring Rewrite Policy Labels

Aug 30, 2013

If you want to build a more complex policy structure than is supported by single policies, you can create policy labels and then bind them as you would policies. A policy label is a user-defined point to which policies are bound. When a policy label is invoked, all the policies bound to it are evaluated in the order of the priority you configured. A policy label can include one or multiple policies, each of which can be assigned its own result. A match on one policy in the policy label can result in proceeding to the next policy, invoking a different policy label or appropriate resource, or an immediate end to policy evaluation and return of control to the policy that invoked the policy label.

A rewrite policy label consists of a name, a transform name that describes the type of policy included in the policy label, and a list of policies bound to the policy label. Each policy that is bound to the policy label contains all of the elements described in "Configuring a Rewrite Policy."

Note: You can use either the command line interface or the configuration utility to create and configure rewrite policy labels. Users who are not thoroughly familiar with the command line interface and the NetScaler Policy Infrastructure (PI) language will usually find using the configuration utility much easier.

To configure a rewrite policy label by using the command line interface

To add a new rewrite policy label, at the command prompt, type the following command:

add rewrite policylabel <labelName> <transform>

For example, to add a rewrite policy label named polLabelHTTPResponses to group all policies that work on HTTP responses, you would type the following:

add rewrite policylabel polLabelHTTPResponses http_res

To modify an existing rewrite policy label, at the NetScaler command prompt, type the following command:

set rewrite policy <name> <transform>

Note: The set rewrite policy command takes the same options as the add rewrite policy command.

To remove a rewrite policy label, at the NetScaler command prompt, type the following command:

rm rewrite policy<name>

For example, to remove a rewrite policy label named polLabelHTTPResponses, you would type the following:

rm rewrite policy polLabelHTTPResponses

To configure a rewrite policy label by using the configuration utility

  1. Navigate to AppExpert > Rewrite > Policy Labels.
  2. In the details pane, do one of the following:
    • To create a new policy label, click Add.
    • To modify an existing policy label, select the policy, and then click Open.
  3. Add or remove policies from the list that is bound to the policy label.
    • To add a policy to the list, click Insert Policy, and choose a policy from the drop-down list. You can create a new policy and add it to the list by choosing New Policy in the list, and following the instructions in "Configuring a Rewrite Policy."
    • To remove a policy from the list, select that policy, and then click Unbind Policy.
  4. Modify the priority of each policy by editing the number in the Priority column.

     

    You can also automatically renumber policies by clicking Regenerate Priorities.

  5. Click Create or OK, and then click Close.

     

    To remove a policy label, select it, and then click Remove. To rename a policy label, select it and then click Rename. Edit the name of the policy, and then click OK to save your changes.