tencent cloud

Feedback

Custom Response Page

Last updated: 2024-06-28 14:21:49

    Overview

    When users encounter issues while accessing the site and receive a response status code, to help them better understand the problem and solution, EdgeOne provides the capability to use custom response pages. This helps inform users about the current status of the website and prevents confusion regarding the error and how to resolve it.
    
    EdgeOne offers custom response page capabilities in both site acceleration and security protection features. You can configure them according to your real-world scenarios:
    Custom Site Origin Error Response Pages: These can display custom page content when 4xx or 5xx status codes are returned from the origin. For details, see Custom Error Page.
    Custom Security Protection Policy Interception Response Pages: You can customize the status code and page content when users trigger Web Protection or Bot Protection interception policies. For details, see Configure Custom Response Pages in Security Protection.
    
    Additionally, to facilitate management and usage, EdgeOne offers the Custom Response Page Template feature, which can be used to manage response page content and be referenced by different feature modules. By editing this response page template, you can simultaneously update the response page content across all referenced feature modules.

    Configure Custom Response Page Template

    You can customize the Content-Type and the included content information of the response page. Follow these steps to configure:
    1. Log in into the EdgeOne console, click on Site List in the left sidebar. Subsequently, within the Site List, select the Site you wish to configure.。
    2. On the site details page, click Custom Response Page.
    3. In the Custom response pages, click Add custom response pages and configure the custom response page content. The related parameters are explained as follows:
    Content-Type: The value of the HTTP Response Header Content-Type included when the custom response page responds. Supported values are application/html, application/json, text/plain, application/xml. For example, if you choose text/plain, when EdgeOne responds with the custom response page, it will return the HTTP Response Header Content-Type: text/plain.
    page content:The body of the custom response page, not exceeding 2KB. It is recommended to include {{ EO_REQ_ID }} in the page content. This field will automatically retrieve the user's request ID information when responding and will be replaced with the request ID, which is convenient for problem localization.
    
    4. Click Save to complete the creation of the response page.
    Note:
    If the custom response page has already been referenced by other feature modules, deletion is not allowed. If deletion is necessary, please go to the feature module that references this page and dereference it first.
    After editing and saving an already created custom response page, all feature modules that reference this custom response page will automatically use the edited page.

    Configure the custom response page response in Security Protection

    Assuming the current site domain www.example.com has a Web Protection custom rule configured to allow only users within the Chinese mainland to access the site and intercept users from other regions. When other users attempt to access, a custom response page should inform them of the interception reason. A custom response page named Custom-Pages1 has already been configured. You can refer to the following steps to configure it:
    1. Log in into the EdgeOne console, click on Site List in the left sidebar. Subsequently, within the Site List, select the Site you wish to configure.
    2. On the site details page, click Security > Custom Pages.
    3. On the Custom Page details page, select the domain name to be configured from the protected domain list on the left, such as: www.example.com.
    4. Select the interception page module to be configured. For example, choose the Security Protection (excluding Managed Rules) interception page, and click Set.
    
    5. On the edit page, configure the content of the custom response page, select Use file Page for interception, and choose the pre-configured page named Custom-Pages1.
    
    6. After completing the configuration, click Save to complete the setup.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support