CTX122736
NetScaler 9.0,NetScaler 9.1
NetScaler 9.0,NetScaler 9.1
Article
2010-01-14
2010-01-14
Summary This article describes how to bind the same advanced policy or groups of advanced policies to multiple content switching virtual servers ...

Summary

This article describes how to bind the same advanced policy or groups of advanced policies to multiple content switching virtual servers using policy labels.

Requirements

A Citrix NetScaler running version 9.0 or later

Background

In NetScaler version 9.0 and later, you can use Policy labels when configuring content switching, which allows you to bind the same advanced policy, or groups of advanced policies, to multiple content switching virtual servers. If you are configuring many content switching virtual servers that all need to have the same content switching rules applied, this can help simplify the configuration by reducing the number of configured content switching policies.

Procedure

In this example;

??鷉G There are four servers, black (10.0.0.1), red (10.0.0.2), green (10.0.0.3), and blue (10.0.0.4).

??鷉G The load balancing virtual servers are not given IP addresses because they are only be accessed through the content switching virtual server and not accessed directly.

??鷉G The server “black” is the default server for the content switching virtual server “cs-vs-1”

??鷉G The server “blue” is the default server for the content switching virtual server “cs-vs-2”

??鷉G For either content switching virtual servers “cs-vs-1” or “cs-vs-2”, HTTP requests with “red” in the URL need to go to the “red” server, and requests with “green” in the URL need to go to the “green” server.

1. Create the services and load balancing virtual servers:
add service black-http-svc 10.0.0.1 HTTP 80
add service red-http-svc 10.0.0.2 HTTP 80
add service green-http-svc 10.0.0.3 HTTP 80
add service blue-http-svc 10.0.0.4 HTTP 80

add lb vserver black-lb-vs HTTP 0.0.0.0 0
add lb vserver red-lb-vs HTTP 0.0.0.0 0
add lb vserver green-lb-vs HTTP 0.0.0.0 0
add lb vserver blue-lb-vs HTTP 0.0.0.0 0

bind lb vserver black-lb-vs black-http-svc
bind lb vserver red-lb-vs red-http-svc
bind lb vserver green-lb-vs green-http-svc
bind lb vserver blue-lb-vs blue-http-svc

2. Create the content switching virtual servers:
add cs vserver cs-vs-1 HTTP 10.100.0.100 80
add cs vserver cs-vs-2 HTTP 10.100.0.101 80

3. Create the content switching policies to evaluate the URL looking for the keywords “red” and “green”
add cs policy red-pol -rule "HTTP.REQ.URL.CONTAINS(\"red\")"
add cs policy green-pol -rule "HTTP.REQ.URL.CONTAINS(\"green\")"

4. Create the content switching policy label, and bind your content switching policies to it. This is also where you define the content switching with the “-targetVserver” flag (“green” in the URL goes to the green server, and “red” in the URL goes to the red server)
add cs policylabel cs-pol-label HTTP
bind cs policylabel cs-pol-label green-pol 90 -targetVserver green-lb-vs
bind cs policylabel cs-pol-label red-pol 100 -targetVserver red-lb-vs

5. Create a separate policy for each content switching vserver, which is used to invoke the policy label:
add cs policy goto-pol-label-1 -rule "SYS.EVAL_CLASSIC_EXPR(\"ns_true\")"
add cs policy goto-pol-label-2 -rule "SYS.EVAL_CLASSIC_EXPR(\"ns_true\")"

6. Bind the default load balancing virtual servers to the content switching virtual servers, and bind the “goto” policies and invoke the policy labels:
bind cs vserver cs-vs-1 black-lb-vs
bind cs vserver cs-vs-1 -policyName goto-pol-label-1 -priority 100 -gotoPriorityExpression END -invoke policylabel cs-pol-label

bind cs vserver cs-vs-2 blue-lb-vs
bind cs vserver cs-vs-2 -policyName goto-pol-label-2 -priority 100 -gotoPriorityExpression END -invoke policylabel cs-pol-label

More Information

See CTX121824 - Citrix NetScaler Policy Configuration and Reference Guide - Release 9.1 for information regarding creating policies.


Applicable Products

特别说明


本文来源为Citrix.com所有,翻译后版权归翻译者所有.如需转载请注明出处.

文档版本


.

广告招租


最新留言


.

广告招租


.