What do users see if all servers are down; can I show a custom page instead?
Short answer
On an HTTP vService, users see TR7's 503 error page; on an L7 TCP vService, the connection is closed by TR7, and on a Network vService, the connection cannot be established. On an HTTP vService, instead of this page, a custom content page is shown with the Show Content for Traffic Manager Errors action, the user is redirected to another address with Redirect for Traffic Manager Errors, or, with a Show Content action that works with the Number of Active Servers condition (= 0), a maintenance page is returned directly when no healthy server remains. On HTTP and L7 TCP vServices, a server that serves a static page can also be added as a Backup Service.
Problem: Users See a Technical Error When All Servers Go Down
During maintenance work, a planned outage or an unexpected failure, all the Backend Services of the vService may become unavailable (e.g. all of them in Error in the health check or in Maintenance Mode). In this case, the HTTP vService returns TR7's generic 503 page; the aim is for users to see an informative page of the organization's own instead, or to be redirected to another address. For these methods to work, a Health Check must be assigned to the Backend Services; a server with no health check assigned is considered available even if it is down.
Solution: 4 Methods
Methods 1, 2 and 3 work with an action on the HTTP vService; Method 4 is having the page served by a separate server.
| Your situation | Suitable method |
|---|---|
| HTTP vService; my own page should be shown instead of TR7's 503 page | Method 1: Show Content for Traffic Manager Errors |
| HTTP vService; the decision should be made by the number of healthy servers (e.g. when none remain or when it drops below 2) | Method 2: Number of Active Servers condition |
| HTTP vService; the user should be sent to another address | Method 3: Redirect for Traffic Manager Errors |
| HTTP or L7 TCP vService; a separate server should show the page | Method 4: Backup service |
Method 1: Show Content for Traffic Manager Errors Recommended
- How it works In the error responses it generates itself (e.g. 503 when no server is available), TR7 returns the selected content page with the selected status code instead of the generic page.
- Where it is openedLoad Balancer → Profiles → Content Pages · Load Balancer → Actions · vService → Details → Actions
- Requirement HTTP vService; the page size must be below the vService buffer limit (Content Pages · Content)
- vService type HTTP
Step-by-Step Configuration
The Configuration Menu is opened with the TR7 logo at the bottom left; the Load Balancer → Profiles → Content Pages path is followed and Add is clicked (How to add?).
Content Page Name is entered; the content is written or one of the ready-made page templates is selected. The page is kept below the vService buffer (Buffer size − 2 KB; about 126 KB with the default 128 KB buffer).
The Add button is clicked.
The Load Balancer → Actions path is followed and Add is clicked.
Action Name is entered, and Show Content for Traffic Manager Errors is selected in the Action Type field. The prepared page is selected in the Content Page field, 503 (and 502 and 504 if needed) is added to the Error Codes field, and Status Code is set to 503 (default 200). The selected Status Code is returned for all the Error Codes in the list; if 502 and 504 are to be returned with their own codes, a separate action is defined for each of them.
The Add button is clicked.
On the Load Balancer → Load Balancer vService List screen, the HTTP vService is selected and the edit form is opened with Edit.
The action is selected in the Details → Actions field. The action does not work unless it is added to the vService.
The form is saved with Save. In a cluster, the change is transferred to the peer device automatically by default; if Manual Sync Mode is on, it is sent with Synchronize.
Verification
While all the Backend Services are unavailable (e.g. by putting them into Maintenance mode in a test environment), a request is sent to the vService.
curl -sv https://www.example.com/HTTP/1.1 503 · content of the custom pageMethod 2: Number of Active Servers Condition
- How it works The Number of Active Servers condition reads the number of available servers in the Default Backend Services list of the vService at the start of each request; servers whose health check is successful and that are not in Maintenance mode are counted, and a server with no health check assigned is always counted. The Show Content action linked to the condition returns the content page without sending the request to a server when the number satisfies the condition (e.g. Equals to 0).
- Where it is openedLoad Balancer → Conditions → Add → Criteria: Number of Active Servers · Load Balancer → Actions → Add → Show Content
- Requirement HTTP vService; health checks assigned to the servers in the Default Backend Services list
- vService type HTTP (Show content action)
- Not counted Servers in Conditional Backend Services (Content Switching) groups are not counted. Servers marked as Backup service are counted when all the main servers are unavailable; for this reason, the value becomes 0 when the backup servers are also unavailable
Step-by-Step Configuration
The Load Balancer → Conditions path is followed and Add is clicked (How to add?).
A name is written in the Condition Name field (e.g. sunucu-kalmadi); Number of active servers is selected in the Criteria list. Equals to (=, default) is left in the Operator field and 0 is written as the value; for a capacity warning, Less than (<) and a value such as 2 can be selected.
The Add button is clicked.
The Load Balancer → Actions path is followed and Add is clicked.
Action Name is entered, and Show Content is selected in the Action Type field. Execution Level is left as On request, the maintenance page is selected in the Content Page field, and Status Code is set to 503 (default 200).
The condition from step 2 is selected in the Conditions field. If no condition is selected, the action is applied to all requests.
The Add button is clicked.
On the Load Balancer → Load Balancer vService List screen, the HTTP vService is selected and the edit form is opened with Edit.
The action is selected in the Details → Actions field.
The form is saved with Save.
Verification
While all the servers in the Default Backend Services list (including the backups) are unavailable, a request is sent to the vService.
curl -sv https://www.example.com/HTTP/1.1 503 · content of the maintenance pageMethod 3: Redirect for Traffic Manager Errors
- How it works For the selected error codes, the user is redirected to the fixed address in the Redirect Location field (e.g. a maintenance page located on another server).
- Where it is openedLoad Balancer → Actions → Add → Redirect for Traffic Manager Errors
- Requirement HTTP vService; the address to redirect to must be reachable independently of this vService
- vService type HTTP
Step-by-Step Configuration
The Load Balancer → Actions path is followed and Add is clicked.
Action Name is entered, and Redirect for Traffic Manager Errors is selected in the Action Type field; 503 is added to the Error Codes field and the address is written in the Redirect Location field (e.g. https://status.example.com/).
The Add button is clicked.
On the Load Balancer → Load Balancer vService List screen, the HTTP vService is selected and the edit form is opened with Edit.
The action is selected in the Details → Actions field.
The form is saved with Save.
Verification
While all the Backend Services are unavailable, a request is sent to the vService.
curl -sv https://www.example.com/Location: https://status.example.com/Method 4: Backup service
- How it works A server that serves a static "out of service" page is added as a Backend Service and Backup Service is checked; when all the main Backend Services of the vService are unavailable, the traffic goes to this server, and when one of the main servers becomes OK again, the traffic returns to it.
- Where it is openedLoad Balancer → Backend Services → Add → Backup Service
- Requirement A separate server to serve the page; a health check assigned to the backup Backend Service as well
- vService type HTTP, L7 TCP
Step-by-Step Configuration
The Load Balancer → Backend Services path is followed and Add is clicked.
The Backend Service Name and the Address information of the page server are entered; a profile is selected in the Health Check field and Backup Service is checked (off by default).
The Add button is clicked.
On the Load Balancer → Load Balancer vService List screen, the vService is selected and the edit form is opened with Edit.
The backup Backend Service is added to the Default Backend Services list.
The form is saved with Save.
Verification
While the main Backend Services are unavailable, requests are answered with the page of the backup server.
The page of the backup serverCommon Mistakes
- Leaving the status code at 200. If the maintenance page returns 200, monitoring tools and search engines do not notice the error; 503 is selected.
- Using the Show content for backend service errors action. That action is for the errors returned by the Backend Service; for the error that TR7 generates when all servers are down, the traffic manager errors actions are used (Traffic manager errors and Backend Service errors).
- Expecting Number of active servers = 0 while there is a backup service. Since the backups are counted when the main servers go down, the value does not become 0; it becomes 0 when the backups are also unavailable.
- Leaving the Show content action without a condition. An action with no condition selected is applied to all requests, and the site constantly returns the maintenance page.
- Expecting a custom page on an L7 TCP or Network vService. No HTTP response is generated in these types; Backup service is used on L7 TCP.
- Not assigning a health check to the backup server. Traffic is sent to it even while the backup is down.
How it is done in the documentation
