Create or modify a policy
All policies have some common elements. Creating a policy consists, at minimum, of naming the policy and configuring a rule. The policy configuration tools for the various features have areas of overlap, but also differences. For the details of configuring a policy for a particular feature, including associating an action with the policy, see the documentation for the feature.
To create a policy, begin by determining the purpose of the policy. For example, you may want to define a policy that identifies HTTP requests for image files, or client requests that contain an SSL certificate. In addition to knowing the type of information that you want the policy to work with, you need to know the format of the data that the policy is analyzing.
Next, determine whether the policy is globally applicable, or if it pertains to a particular virtual server. Also consider the effect that the order in which your policies are evaluated (which will be determined by how you bind the policies) will have on the policy that you are about to configure.
Create a policy by using the CLI
At the command prompt, type the following commands to create a policy and verify the configuration:
- add responder|dns|cs|rewrite|cache policy -rule [] - show rewrite policy
Example 1:
add rewrite policy "pol_remove-ae" true "act_remove-ae" Done > show rewrite policy pol_remove-ae Name: pol_remove-ae Rule: true RewriteAction: act_remove-ae UndefAction: Use Global Hits: 0 Undef Hits: 0 Bound to: GLOBAL RES_OVERRIDE Priority: 90 GotoPriorityExpression: END Done
Example 2:
添加缓存策略BranchReportsCachePolicy规则问{http.req.url.query.value("actionoverride").contains("branchReport s")} -action cache Done show cache policy BranchReportsCachePolicy Name: BranchReportsCachePolicy Rule: http.req.url.query.value("actionoverride").contains("branchReports") CacheAction: CACHE Stored in group: DEFAULT UndefAction: Use Global Hits: 0 Undef Hits: 0 Done
Note:At the command line, quote marks within a policy rule (the expression) must be escaped or delimited with the q delimiter. For more information, seeConfigure advanced policy expressions: Get started.
Create or modify a policy by using the GUI
- In the navigation pane, expand the name of the feature for which you want to configure a policy, and then clickPolicies. For example, you can selectContent Switching, Integrated Caching, DNS, Rewrite, or Responder.
- In the details pane, clickAdd, or select an existing policy and clickOpen. A policy configuration dialog box appears.
- Specify values for the following parameters. (An asterisk indicates a required parameter. For a term in parentheses, see the corresponding parameter in “Parameters for creating or modifying a policy.”)
- ClickCreate, and then clickClose.
- ClickSave. A policy is added. Note: After you create a policy, you can view the policy’s details by clicking the policy entry in the configuration pane. Details that are highlighted and underlined are links to the corresponding entity (for example, a named expression).