How do I publish a maintenance page?
Short answer
For planned maintenance, the most direct way is to prepare the maintenance page in Content Pages and add it to the Actions field of the vService with the Show Content action (Execution Level On Request, Status Code 503); requests do not go to the Backend Services. Maintenance can also be done by putting the Backend Services into Maintenance Mode; in this case, the Show Content for Traffic Manager Errors action shows the page instead of the 503 that TR7 produces (Status code 503 is selected; the default is 200). If the page is hosted outside TR7, Redirect for Traffic Manager Errors or Location Redirection is used; if there is a separate maintenance server, Backup Service is used.
Problem: Users See Errors During Maintenance
While the application is being updated or the servers are in maintenance, users see a connection error or the generic 503 page of TR7. Instead, a page that explains that maintenance is in progress is shown; when the page returns with the 503 code, search engines consider the situation temporary and do not index the page.
Solution: Seven Methods
The methods are divided into two groups: those that show the page immediately, regardless of the status of the servers (Methods 1, 6), and those that take effect when the servers are put into maintenance or crash (Methods 2–5). In every case, the maintenance page is shown on an HTTP vService; only Backup Service also works on L7 TCP.
| Your situation | Suitable method |
|---|---|
| Planned maintenance; the page should be shown immediately, regardless of the status of the servers | Method 1: Show content |
| The servers will be put into Maintenance mode; the page should stay on TR7 | Method 2: Maintenance mode + Show Content for Traffic Manager Errors |
| The page should appear only while all the servers are disabled | Method 3: Show content + Number of Active Servers |
| The servers are in maintenance; the page is hosted outside TR7 | Method 4: Redirect for Traffic Manager Errors |
| A separate server should serve the maintenance page | Method 5: Backup service |
| During planned maintenance, everyone should be sent to a maintenance address outside TR7 | Method 6: Location redirection |
| From the command line | Method 7: WEB-CLI |
Method 1: Show Content Recommended
- How it works TR7 produces the response itself at the request stage; the request does not go to the Backend Service, and the actions that come after this action in the list do not run.
- Where it is openedLoad Balancer → Profiles → Content Pages · Load Balancer → Actions → Show Content
- Requirement The maintenance page is in Content Pages; the CSS and images of the page are embedded in the page
- vService type HTTP
Step-by-Step Configuration
Load Balancer → Profiles → Content Pages → Add is clicked (how to add).
If desired, one of the ready page templates at the top of the form is clicked and the content is copied to the form. Content Page Name (required, unique) is entered, Content Type is left at the default text/html, and the maintenance text is written in the Content field. Details: What is the Content Pages profile; how do I prepare my own HTML page?
Add is clicked.
Load Balancer → Actions → Add is clicked.
Action Name is entered, and Action Type = Show Content is selected.
- Execution Level = On request (default); the request is never sent to the Backend Service.
- Content Page = the page from step 3 (the default is Access Denied Page (English)).
- Status Code = 503 (the default is 200).
- If Conditions is left empty, all requests see the maintenance page. For the team to access the site during maintenance, a Source IP condition (Manual,
198.51.100.0/24) that defines the office network is created, and here its negated form, which appears in the list in the!ConditionNameform, is selected (Can I use a condition in negated form ("if not")?).
Add is clicked.
On the Load Balancer → Load Balancer vService List screen, the HTTP vService is selected and Edit is clicked.
Save is clicked. The change is applied without dropping open connections; in a cluster, it is also sent to the peer device with the default auto-sync (with Synchronize if Manual Sync Mode is on). When the maintenance ends, the action is removed from the same field and the vService is saved again.
Verification
curl -i https://www.example.com/
HTTP/1.1 503 + maintenance page; normal response from the office networkOn the HTTP Logs screen, the requests appear with the 503 status code and without being sent to a Backend Service.
Status code 503Method 2: Maintenance Mode + Show Content for Traffic Manager Errors
- How it works A Backend Service in Maintenance mode does not receive new connections; its open connections are completed. When no usable server is left, TR7 produces 503; the action puts the selected page in place of this error response.
- Where it is openedLoad Balancer → Backend Services → Maintenance Mode · Actions → Show Content for Traffic Manager Errors
- Requirement All the Backend Services on the vService are put into maintenance
- vService type HTTP
Step-by-Step Configuration
If the maintenance page is not in Content Pages, it is added with steps 1–3 of Method 1.
Load Balancer → Actions → Add is clicked.
Action Type = Show Content for Traffic Manager Errors is selected.
503 is selected in the Error Codes list (502 and 504 can be added to also cover server errors; all the selected codes return with the single Status code below); Content Page = the maintenance page; Status Code = 503. If Status code is left at the default 200, the error response goes with the 200 code. Since this action does not add a character set to the response, <meta charset="utf-8"> must be in the head section of a page with Turkish characters.
Add is clicked.
The vService is opened with Edit.
The action is selected in the Details → Actions field.
Save is clicked. The action works without a condition and takes effect only on the selected errors that TR7 itself produces; it can stay on the vService outside maintenance.
On the Load Balancer → Backend Services screen, the Backend Service is selected and Edit is clicked (Edit).
Maintenance Mode (off by default) is turned on.
Edit at the bottom of the form is clicked; steps 9–11 are repeated for each Backend Service on the vService. When the maintenance ends, Maintenance mode is turned off; once the health check succeeds, the server returns to traffic.
Verification
curl -i https://www.example.com/
HTTP/1.1 503 + maintenance pageIn the Backend Services list, the maintenance (ambulance) icon appears next to the names of the servers in maintenance.
All servers marked with the maintenance iconMethod 3: Show Content + Number of Active Servers Condition
- How it works The page is shown only while none of the servers in the Default Backend Services list of the vService is available; as soon as the servers return, the traffic returns to normal on its own.
- Where it is openedConditions → Number of Active Servers · Actions → Show Content
- Requirement A health check on the Backend Services; a server with no health check is always considered healthy
- vService type HTTP
Step-by-Step Configuration
If the maintenance page is not in Content Pages, it is added with steps 1–3 of Method 1.
Load Balancer → Conditions → Add is clicked.
Criteria = Number of Active Servers, Operator = Equals to (default) and the value 0 are entered. Servers whose health check fails or that are in Maintenance mode are not counted; the servers in Conditional Backend Services are not included in this number.
Add is clicked.
Load Balancer → Actions → Add is clicked.
Action Type = Show Content is selected: Execution Level = On request, Content Page = the maintenance page, Status Code = 503, Conditions = the condition from step 3 (automatic maintenance page scenario).
Add is clicked.
The vService is opened with Edit.
The action is selected in the Details → Actions field.
Save is clicked.
Verification
All the servers are put into maintenance or stopped, and curl -i https://www.example.com/ is sent; it is repeated when a server is turned back on.
503 + maintenance page while there is no server · normal response when a server returnsMethod 4: Redirect for Traffic Manager Errors
- How it works On the selected errors that TR7 produces, the client is redirected with 302 to the maintenance address hosted outside TR7.
- Where it is openedLoad Balancer → Actions → Redirect for Traffic Manager Errors
- Requirement A maintenance address reachable outside TR7; the Backend Services in maintenance
- vService type HTTP
Step-by-Step Configuration
Load Balancer → Actions → Add is clicked.
Action Type = Redirect for Traffic Manager Errors is selected.
503 is selected in the Error Codes list; the maintenance address (https://durum.example.com/bakim) is written in the Redirect Location field.
Add is clicked.
The vService is opened with Edit.
The action is selected in the Details → Actions field.
Save is clicked.
On the Load Balancer → Backend Services screen, the Backend Service is selected and Edit is clicked.
Maintenance Mode is turned on.
Edit at the bottom of the form is clicked; steps 8–10 are repeated for each Backend Service on the vService.
Verification
curl -sI https://www.example.com/
302 + Location: https://durum.example.com/bakimMethod 5: Backup Service
- How it works The server that serves the maintenance page is added as a backup; when the main servers are put into maintenance or crash, the traffic goes to the backup, and when the main servers return, the traffic returns to them on its own.
- Where it is openedLoad Balancer → Backend Services → Backup Service
- Requirement A separate server that serves the maintenance page
- vService type HTTP · L7 TCP
Step-by-Step Configuration
Load Balancer → Backend Services → Add is clicked.
The address of the maintenance server is entered (e.g. 192.0.2.50:80; How is a Backend Service added; which information is required?); Backup Service (off by default) is turned on. A health check profile is selected so that it is also monitored whether the backup is working.
Add is clicked.
The vService is opened with Edit.
The maintenance server is added to the Default Backend Services list. In normal operation, no traffic goes to the backup.
Save is clicked.
On the Load Balancer → Backend Services screen, the main Backend Service is selected and Edit is clicked.
Maintenance Mode is turned on.
Edit at the bottom of the form is clicked; steps 7–9 are repeated for each main Backend Service. When all the main servers are put into maintenance, the traffic moves to the backup server. If there is more than one backup, only the first available backup receives traffic.
Verification
curl -i https://www.example.com/
Page of the maintenance serverMethod 6: Location Redirection
- How it works Throughout the planned maintenance, all the requests that match the condition are redirected with 302 to the maintenance address outside TR7; the status of the servers is not considered.
- Where it is openedLoad Balancer → Actions → Location Redirection
- Requirement At least one condition (Location redirection without a condition does not work); a maintenance address reachable outside TR7
- vService type HTTP
Step-by-Step Configuration
Load Balancer → Actions → Add is clicked.
Action Type = Location Redirection is selected.
Redirect Code = 302: Found (Moved Temporarily); Redirect Location = https://durum.example.com/bakim. In the Conditions field, the ready-made Always condition is selected for everyone or, if the team is to be excluded, the negated form of the office network Source IP condition, which appears in the !ConditionName form.
Add is clicked.
The vService is opened with Edit.
The action is selected in the Details → Actions field.
Save is clicked. When the maintenance ends, the action is removed.
Verification
curl -sI https://www.example.com/herhangi-bir-sayfa
302 + Location: https://durum.example.com/bakimMethod 7: WEB-CLI
- How it works The page, the Show content action and the vService binding from Method 1 are created with WEB-CLI commands.
- Where it is opened TR7 WEB-CLI →
lb page·lb action·lb service - Requirement WEB-CLI access; the page content is written on a single line and without the
|character (a long or multi-line page is prepared from the interface) - vService type HTTP
Step-by-Step Configuration
Page command; if --contentType is not written, text/html is used:
lb page add name bakim-sayfasi --content "<h1>Bakımdayız</h1><p>Kısa süre sonra yeniden hizmetteyiz.</p>"An action that works without a condition, at the request stage (default), and returns 503; --contentProfile takes the name of the page:
lb action add type showContent name bakim --contentProfile bakim-sayfasi --statusCode 503lb service show <vService>The rules.0, rules.1 … lines in the output show the actions on the vService in order. --rules.N replaces the action at that position; the new action is written to the first empty position.
If the vService has two actions (0 and 1), the new action is written to position 2; if it has no actions, --rules.0 is used:
lb service update id <vService> --rules.2 bakimWhen the maintenance ends, the action is removed from the list with lb service update id <vService> --rules.2.delete; if the order has changed in the meantime, the position to be deleted is first seen with lb service show.
Verification
curl -i https://www.example.com/
HTTP/1.1 503 + BakımdayızCommon Mistakes
The Status code default is 200
In the Show content and Show Content for Traffic Manager Errors actions, Status Code comes as 200 by default. If it is not changed, the maintenance page looks like real content to search engines, and error responses go with the 200 code; 503 is selected for the maintenance page.
- Using Show content for backend service errors while all the servers are down. This action works only on responses returned from the Backend Service; for the 503 that TR7 produces when there is no server, Show Content for Traffic Manager Errors is used.
- Fetching the CSS and images of the page from the Backend Service. Since the servers are down during maintenance, the styles and images do not load; they are embedded in the page or fetched from an address outside TR7.
- Forgetting to remove the action when the maintenance ends. As long as Show content or Location redirection stays on the vService, all requests see the maintenance page.
- Relying on Number of active servers without a health check. A server with no health check assigned is always considered healthy; the condition never becomes 0.
- Thinking that the page has to be written from scratch. Ready-made pages can be copied as templates and edited (Are there ready-made maintenance / error page templates?).
How it is done in the documentation
