Configuring Rewrite Policy Labels
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 the 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 inConfiguring 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 Citrix ADC 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
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 Citrix ADC command prompt, type the following command:
set rewrite policy
Note:
The set rewrite policy command takes the same options as the add rewrite policy command.
To remove a rewrite policy label, at the Citrix ADC command prompt, type the following command:
`rm rewrite policy
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
Navigate toAppExpert>Rewrite>Policy Labels.
In the details pane, do one of the following:
- To create a new policy label, clickAdd.
- To modify an existing policy label, select the policy, and then click Open.
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.
Modify the priority of each policy by editing the number in the Priority column.
You can also automatically renumber policies by clicking Regenerate Priorities.
ClickCreateorOK, and then clickClose.
To remove a policy label, select it, and then clickRemove. To rename a policy label, select it and then click Rename. Edit the name of the policy, and then clickOKto save your changes.