The following topics describe how to configure SureConnect for scenarios involving alternate server failure.
If the alternate server fails, and the primary server cannot immediately deliver the requested content to the client, SureConnect does not display alternate content from the failed alternate server in the client Web browser.
The Citrix NetScaler appliance automatically sends a response to the client browser. You can customize the server response to display information suited to your needs.
The default response is:
Your Request is being processed… Estimated Time: ____ Secs
The NetScaler appliance automatically sends the response to the client if the alternate server fails, or if the appliance is configured to send the default response.
Change any of the contents between the </HEAD> and </HTML> tags in the vsr.htm file. Following is the sample content from vsr.htm file. The sections that you can edit are in bold text.
HTTP/1.1 200 OK Server: NS_WS3.0 Content-Type: text/html Cache-control: no-cache Pragma: no-cache Set-Cookie: NSC_BPIP=@@SID@@; path=/ <HTML> <HEAD> <META HTTP-EQUIV="Refresh" CONTENT="0"> </HEAD> <font color=blue size=5>Your request is being processed... <br>Estimated Delay: @@DELAY@@ Sec </font> </HTML>
When defining the SureConnect policy by using the add sc policy command, you can configure the NetScaler Appliance to serve alternative content to the client.
The following example illustrates how to configure SureConnect for the load balancing feature so that SureConnect will display alternative content from the NetScaler appliance.
In this example, two physical servers, with IP addresses, 10.101.3.187 and 10.101.3.188 are load balanced by the NetScaler appliance. The appliance has one configured virtual server, vs-NSact, whose IP address is 10.101.3.201. The file that contains the alternative content is vsr.htm. It is copied from the file system into system memory. Services are loaded until the SureConnect policy triggers, and the appliance supplies the alternate content.
enable feature SC LB add service psvc1 10.101.3.187 http 80 add service psvc2 10.101.3.188 http 80 add lb vserver vs-NSact HTTP 10.101.3.201 80 bind lb vserver vs-NSact psvc1 bind lb vserver vs-NSact psvc2 add sc policy policyNS -url /cgi-bin/*.cgi -delay 400000 -action NS set sc parameter -vsr /nsconfig/ssl/vsr.htm bind lb vserver vs-NSact -policyName policyNS set lb vserver vs-NSact -sc ON save config
|Load Balancing Virtual Server|
|VSR File Name||vsr.htm|
When you configure an exact URL based policy, the NetScaler appliance matches the incoming request against the URL that has been configured in the policy. URL based policies take precedence over rule based policies.
At the command prompt, type:
Use the add expression command to create each expression.
Use the add sc policy command with the -rule expression_logic argument to specify the rule(s). In the -rule expression_logic argument, refer to the expression(s) you created in step 1.
Repeat this command to create and name each rule.
The following example creates a rule “rule = = /*.cgi”:
add vserver vs-lb http 22.214.171.124 80 add expression expr1 url == /cgi-bin/*.cgi add expression expr2 url == /index.html add sc policy surecpolicy1 -rule (expr1||expr2) -delay 1000000 -action NS bind lb vserver vs-lb -policyName surecpolicy1
To complete the SureConnect configuration, you will need to enter additional commands, beyond those shown in the example.
Examples of wildcard rules:
“/sports/*” matches all URLs under /sports
“/sports*” matches all URLs whose prefix matches “/sports”, starting at the beginning of the URL.
“/*.jsp” matches all URLs whose file extension is “jsp”
When configuring rule-based policies, first add the more specific rule-based policies, before adding more generic rules (for example, add /cgi-bin/sports*.cgi before adding /cgi-bin/*.cgi).
//**** DEFINE YOUR VALUES HERE **** var alt_url = "/Citrix NetScaler system /sample.gif"; var alt_url = "http://www.DomainName.com"; var Citrix NetScaler system _logo = "netscaler_logo.gif"; var our_logo = "netscaler_logo.gif"; var height = 450; var width = 550; var top = 200; var left = 200; var popunder = "no"; //specify yes for pop-under & no for pop-up var shift_focus = "yes" //if you want to send pop-up to background on getting primary content else specify no //**** YOUR DEFINITIONS ENDS HERE ****
var alt_url = “/Citrix NetScaler system/sports.htm”
This section describes how SureConnect works in combination with the load balancing, content switching, cache redirection, and high availability features of the NetScaler appliance.
You can use SureConnect in environments where the primary servers use the load balancing feature, with or without alternate servers. If the load balancing virtual server configured for SureConnect fails, the backup virtual server (if there is one) handles the traffic. Backup virtual servers do not support SureConnect policies.
SureConnect is compatible with NetScaler appliances operating in high availability mode.