A common request from customers during Citrix Netscaler reverse proxy and load balancing implementations is to show the visitors of a website a user friendly maintenance or error page when the website is offline or manually put in maintenance mode. This can off course be handled by the application itself, but with the Netscaler appliances it is also possible to show a maintenance page hosted on the Netscaler itself. This can be used as a fallback regardless of the backend application.
This blog post will show one of the methods how this can be achieved. In this method, we will use a dummy load balancing virtual server that is always responding with a maintenance page. The maintenance page itself is located on the Netscaler so no separate web server is required.
- Create a dummy Load Balancing service. The service can point to e.g. 220.127.116.11. The service will in reality never be used. The reason we need the dummy service is to make sure we have a dummy load balancing virtual server that is always UP. To make sure the Netscaler detects the service as UP, edit the service and disable health monitoring.
- Create dummy Load Balancing Virtual Server. This virtual server does not need an IP Address assigned, so choose “Non Addresssable”.
- Bind the dummy service to the dummy LB Virtual Server.
- Create a responder action (AppExpert > Responder > Actions ).
- Responder action type= “Respond with HTML Page”. HTML Page = Create from Text/Html. (See below for examples)
- Create a responder policy with expression “true” and the just created action linked.
- Edit the dummy load balancing virtual server and assign the responder policy.
Now for every ‘normal’ load balancing virtual server that is used by clients, the dummy load balancing virtual server can be assigned as the backup virtual server (using the ‘protection’ settings). As soon as all backend services are offline or the LB VS is disabled manually on the Netscaler, the netscaler will respond with the configured HTML page.
Here are some example HTML pages that can be fully customized to your liking. To simplify hosting the HTML pages on the Netscaler the images are embedded in the HTML code using Base 64 encoding. The examples can be saved as .HTML file, edited and uploaded to the NS.
Example 1 : Download Link (txt format)
Example 2 : Download Link (txt format)
Example 3 : Download Link (txt format)