What is the Content Pages profile; how do I prepare my own HTML page?
Short answer
Content Pages is the profile that centrally holds the contents (such as HTML, JSON and plain text) that TR7 returns directly to the client; it is not assigned directly to a vService; features such as the Show Content and error actions, WAF and L7 DDoS / Threat Protection use it. To prepare a custom page, Content Page Name, Content Type (default text/html) and Content are entered with Load Balancer → Profiles → Content Pages → Add; the content is written visually in the Visual editor or with code in the HTML source mode, and it is also possible to start from a ready-made page. The page must not exceed the buffer size (Buffer Size(kB)) of the vService on which it is used minus 2 kB.
Problem: A Page Belonging to the Organization Is Needed
In situations such as maintenance, errors, access blocks or static responses, TR7 needs to return content that matches the look of the organization. The content is prepared once and is used by being selected in different actions and profiles; a change made to the page is reflected everywhere the page is used.
Solution: Two Methods
| Your situation | Suitable method |
|---|---|
| Preparing the page in the interface (visually, with code or from a template) | Method 1: Content Pages form |
| Creating a short page from the command line | Method 2: WEB-CLI |
Method 1: Content Pages Form Recommended
- How it works The page is saved with a page name, a content type and the content; the content is written in the visual editor or as HTML source.
- Where it is openedLoad Balancer → Profiles → Content Pages → Add
- Requirement CSS, fonts and images embedded in the page (the page is often shown while the servers are unreachable)
- Scope All the actions and profiles that select the page
Step-by-Step Configuration
Load Balancer → Profiles → Content Pages → Add is clicked (add form).
If one of the ready-made page buttons at the top of the form (e.g. Access Denied Page (Turkish)) is clicked, its content and type are copied into the form; the name is not copied. Details: Are there ready-made maintenance / error page templates?
Content Page Name must be unique (if the same name is entered, the Name is used warning appears). Content Type is text/html by default; application/json is selected for JSON and text/plain for plain text, or a type that is not in the list is written manually (it cannot contain spaces).
The mode is selected with the HTML source ⇄ Visual editor switch next to the Content field. The mode is set automatically according to the content: a full page that starts with <!doctype or <html> opens in the Visual editor, and the others and an empty page open in HTML source. Since the Visual editor converts the content into its own form at the save, the mode is switched to HTML source before a manually written page that contains styles is pasted.
In the Visual editor, text, formatting, tables, links and images (URL or base64) are added; in HTML source, code is written. Styles are embedded in the page inside <style>, small images are added as base64, and <meta charset="utf-8"> is written for Turkish characters. The field accepts at most 153,600 characters; however, the presented page must not exceed the Buffer Size(kB) value of the vService minus 2 kB (approximately 126 kB with the default 128 kB). A page that exceeds this limit prevents the vService configuration from being loaded; if a large page is needed, a vService Limits profile with a larger Buffer size(kB) value is assigned to the vService.
Add is clicked. The page is used by being selected in the Content Page field of the Show content and error actions, or in the WAF and L7 DDoS / Threat Protection profiles.
Verification
On the Details tab of the preview that opens when the page is clicked in the Content Pages list, the page appears in its rendered form.
Expected look, Turkish characters correctThe Used in tab in the preview shows the actions that use the page.
The actions that select the page are listedMethod 2: WEB-CLI
- How it works The page is created in a single line with the lb page command.
- Where it is opened TR7 WEB-CLI →
lb page add - Requirement WEB-CLI access; the content is written in a single line and without the
|character (long HTML pages are prepared from the interface) - Scope All the actions and profiles that select the page
Step-by-Step Configuration
A plain text warning page; if --contentType is not written, text/html is used:
lb page add name kisa-uyari --contentType text/plain --content "Servis gecici olarak kapali."lb page listVerification
The page appears in the lb page list output and in the Content Pages list in the interface.
kisa-uyari · text/plainCommon Mistakes
The page must fit in the vService buffer
If the presented page exceeds the Buffer size(kB) value of the vService on which it is used minus 2 kB, not only the page but the entire vService configuration cannot be loaded. Large images are not embedded; if needed, a vService Limits profile with a larger Buffer size(kB) value is assigned to the vService.
- Saving a styled page in the Visual editor. The Visual editor converts the content into its own form at the save; manually written pages are edited in the HTML source mode.
- Linking to external resources. The page is often shown while the servers are unreachable; CSS, fonts and images are embedded in the page.
- Selecting the wrong content type.
application/jsonis selected for a JSON response andtext/plainfor plain text; the value cannot contain spaces. - Deleting or changing a page that is in use. The Used in tab in the preview lists only actions; the WAF, L7 DDoS / Threat Protection, CAPTCHA and AGS usages are checked separately. An action that uses a deleted page cannot show content (Used in).
How it is done in the documentation
