Product Documentation

Managing a Content Switching Setup

Jun 08, 2015

After a content switching setup is configured, it may require periodic changes. When operating systems or software are updated, or hardware wears out and is replaced, you may need to take down your setup. Load on your setup may increase, requiring additional resources. You may also modify the configuration to improve performance.

These tasks may require unbinding policies from the content switching virtual server, or disabling or removing content switching virtual servers. After you have made changes to your setup, you may need to re-enable servers and rebind policies. You might also want to rename your virtual servers.

Unbinding Policies from the Content Switching Virtual Server

When you unbind a content switching policy from its virtual server, the virtual server no longer includes that policy when determining where to direct requests.

To unbind a policy from a content switching virtual server by using the command line interface

At the command prompt, type:

unbind cs vserver <name> -policyname <string>

Example

unbind cs vserver Vserver-CS-1 -policyname Policy-CS-1

To unbind a policy from a content switching virtual server by using the configuration utility

  1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open the virtual server.
  2. Click in the Policies section, select the policy, and click Unbind.

Removing Content Switching Virtual Servers

You normally remove a content switching virtual server only when you no longer require the virtual server. When you remove a content switching virtual server, the NetScaler appliance first unbinds all policies from the content switching virtual server, and then removes it.

To remove a content switching virtual server by using the command line interface

At the command prompt, type:

rm cs vserver <name>

Example

rm cs vserver Vserver-CS-1

To remove a content switching virtual server by using the configuration utility

Navigate to Traffic Management > Content Switching > Virtual Servers, select a virtual server, and click Delete.

Disabling and Re-Enabling Content Switching Virtual Servers

Content switching virtual servers are enabled by default when you create them. You can disable a content switching virtual server for maintenance. If you disable the content switching virtual server, the state of the content switching virtual server changes to Out of Service. While out of service, the content switching virtual server does not respond to requests.

To disable or re-enable a virtual server by using the command line interface

At the command prompt, type one of the following commands:

  • disable cs vserver <name>
  • enable cs vserver <name>

Example

disable cs vserver Vserver-CS-1 
 
enable cs vserver Vserver-CS-1

To disable or re-enable a virtual server by using the configuration utility

Navigate to Traffic Management > Content Switching > Virtual Servers, select a virtual server and, in the Action list, select Enable or Disable.

Renaming Content Switching Virtual Servers

You can rename a content switching virtual server without unbinding it. The new name is propagated automatically to all affected parts of the NetScaler configuration.

To rename a virtual server by using the command line interface

At the command prompt, type:

rename cs vserver <name> <newName>

Example

rename cs vserver Vserver-CS-1 Vserver-CS-2

To rename a virtual server by using the configuration utility

Navigate to Traffic Management > Content Switching > Virtual Servers, select a virtual server and, in the Action list, select Rename.

Managing Content Switching Policies

You can modify an existing policy by configuring rules or changing the URL of the policy, or you can remove a policy. You can also rename an existing advanced content switching policy. You can create different policies based on the URL. URL-based policies can be of different types, as described in the following table.

Table 1. Examples of URL-Based Policies

Type of URL-Based Policy

Specifies

Domain and Exact URL

Requests must match the configured domain name and configured URL (an exact prefix match if only the prefix is configured; or an exact match of the prefix and suffix if both the prefix and suffix are configured).

Example:

add cs policy Policy-CS-1 -url /sports/tennis/index.html -domain "www.domainxyz.com"

Domain and Wild Card URL

Requests must match the exact domain name and a partial prefix of the configured URL.

Example:

add cs policy Policy-CS-1 -url /*.jsp -domain "www.domainxyz.com"

 

Domain Only

Requests need match only the configured domain name.

Example:

add cs policy Policy-CS-1 -domain "www.domainxyz.com"

The Exact URL

The incoming URL must exactly match the URL specified by the policy. If only a URL prefix rule is configured, there must be an exact prefix match with the incoming URL. If a URL prefix and suffix-based rule is configured, there should be an exact match of the prefix and suffix with the incoming URL.

Example:

add cs policy Policy-CS-1 -url /sports/tennis/index.html

Prefix Only (Wild Card URL)

All the incoming URLs must start with the configured prefix.

Example:

add cs policy Policy-CS-1 -url /sports*

sports/*” matches all URLs under /sports “/sports*” matches all URLs whose prefix match “/sports” starting from the beginning of a URL

Suffix Only (Wild Card URL)

All incoming URLs must end with the configured URL suffix.

Example:

add cs policy Policy-CS-1 -url /*.jsp

 

“/*.jsp” matches all URLs whose file extension is “jsp”


Prefix and Suffix (Wild Card URL)

All incoming URLs must start with the configured prefix and end with the configured suffix.

Example:

add cs policy Policy-CS-1 -url /sports/*.jsp

 

Note: You can configure rule-based content switching using classical policy expressions or advanced policy expressions.

To modify, remove, or rename a policy by using the command line interface

At the command prompt, type one of the following commands:

  • set cs policy <policyName> [-domain <domainValue>] [-rule <ruleValue>] [-url <URLValue>]
  • rm cs policy <policyName>
  • rename cs policy <policyName> <newPolicyName>

Example

set cs policy Policy-CS-1 -domain "www.domainxyz.com" 
 
set cs policy Policy-CS-1 -rule "CLIENT.IP.SRC.SUBNET(22).EQ(10.100.148.0)" 
 
set cs policy Policy-CS-2 -rule "SYS.TIME.BETWEEN(GMT 2010 Jun,GMT 2010 Jul)" 
 
set cs policy Policy-CS-1 -url /sports/* 
 
rename cs policy Policy-CS-1 Policy-CS-11 
 
rm cs policy Policy-CS-1

To modify, remove, or rename a policy by using the configuration utility

  1. Navigate to Traffic Management > Content Switching > Policies.
  2. Select the policy, and either delete it, edit it or, in the Action list, click Rename.