This article contains information about configuring Responder policies that redirect user requests to custom error pages during a maintenance period of a back end web server farm.
You can create custom error page and redirect the user requests to it. For example, you might want to host a website in which each section of the website has an associated error page that appropriately redirects the user requests. During the maintenance period, when a user request cannot be processed, these error pages are displayed.
To configure Responder policies to redirect user requests to custom error pages during the maintenance period, complete the following procedure:
Host custom error pages at external locations.
For example, host the following error pages at external locations to ensure that the error pages are displayed during the maintenance period:
http://in.example.com
http://uk.example.com
http://jp.example.com
Log on to the NetScaler appliance by using an SSH utility.
Run the following commands to create Load Balancing virtual servers:
add lb vserver lb_vs_india HTTP 0.0.0.0 0 -persistenceType NONE -state DISABLED -cltTimeout 180
add lb vserver lb_vs_uk HTTP 0.0.0.0 0 -persistenceType NONE -state DISABLED -cltTimeout 180
add lb vserver lb_vs_japan HTTP 0.0.0.0 0 -persistenceType NONE -state DISABLED -cltTimeout 180
Run the following command to create the Content Switching virtual servers:
add cs vserver cs_vserver_customer HTTP 10.10.10.10 80 -cltTimeout 180
Run the following commands to bind policies to the respective virtual servers:
bind cs vserver cs_vserver_customer lb_vs_india -policyName india -priority 8
bind cs vserver cs_vserver_customer lb_vs_uk -policyName uk -priority 9
bind cs vserver cs_vserver_customer lb_vs_japan -policyName japan -priority 10
Note: Use a combination of Load Balancing virtual servers and Content Switching virtual servers to create unique error pages for various sub-domains. In this example, the sub-domains are created based on countries.
Also you have to create three policies for India, UK, JAPAN so that specific requests can be redirected to respective content switching virtual server.
Run the following commands to create the Responder actions. These Responder actions redirect user requests to the error pages:
add responder action redirect_customer_japan_error_page respondwith q{"HTTP/1.1 307 MOVED TEMPORARILY\r\n" + "Location: http://jp.example.com\r\n" + "Connection: close\r\n" + "\r\n"}
add responder action redirect_customer_uk_error_page respondwith q{"HTTP/1.1 307 MOVED TEMPORARILY\r\n" + "Location: http://uk.example.com \r\n" + "Connection: close\r\n" + "\r\n"}
add responder action redirect_customer_india_error_page respondwith q{"HTTP/1.1 307 MOVED TEMPORARILY\r\n" + "Location: http://in.example.com \r\n " + "Connection: close\r\n" + "\r\n"}
Run the following commands to configure the Responder policies:
add responder policy pol_japan_redirect "HTTP.REQ.HOSTNAME.STARTSWITH(\"japan\")" redirect_customer_japan_error_page
add responder policy pol_uk_redirect "HTTP.REQ.HOSTNAME.STARTSWITH(\"uk\")" redirect_customer_uk_error_page
add responder policy pol_india_redirect "HTTP.REQ.HOSTNAME.STARTSWITH(\"india\")" redirect_customer_india_error_page
Create the file, error pages.conf in the /var/error directory. This file contains the following commands:
bind lb vserver "lb_vs_japan” -policyName "pol_japan" -priority 1 -gotoPriorityExpression END
bind lb vserver "lb_vs_uk” -policyName "pol_uk" -priority 1 -gotoPriorityExpression END
bind lb vserver "lb_vs_india” -policyName "pol_india" -priority 1 -gotoPriorityExpression END
Note: The preceding commands are used to bind the Responder policies so that the appropriate error pages are displayed to the users.
Before the maintenance work starts, you can activate the Responder configuration. Run the following command from the command line interface to activate the Responder policies:
batch –f /var/error/errorpages.conf