Origin URL Rewrite Configuration

Last updated: 2021-03-29 16:17:52

    Configuration Overview

    If you need to modify the origin-pull request URL to the URL that matches the origin server, you can use the origin URL rewrite configuration in Tencent Cloud CDN.

    Configuration Guide

    Viewing configuration

    Log in to the CDN console, select Domain Management on the left sidebar, click Manage on the right of a domain name to enter its configuration page, and switch to the Origin-pull Configuration tab to find the Origin URL Rewrite Configuration section.

    Adding rules

    You can click Add Rule to add rewrite rules as needed.

    Configuration limitations

    • Each domain name can have up to 100 rewrite rules.
    • You can adjust the priority for multiple rules. Rules at the bottom of the list have higher priority.
    • Current Origin URL: starting with /; supporting full-path matching (e.g., /test/a.jpg) and wildcard () matching (e.g., /test//*.jpg). If you want to specify a file directory, you cannot end the path with / (e.g., /test).
    • Target Origin Domain: the current domain name is used by default (excluding http:// and https://). You can modify it as needed.
    • Target Origin Path: starting with / (e.g., /newtest/b.jpg); the wildcard * can be captured with $n (e.g., if n=1,2,3… then /newtest/$1/$2.jpg). If you want to specify a file directory, you cannot end the path with / (e.g., /test).
    • Up to 5 * and 10 $n are supported.
    • The target origin domain can contain up to 250 characters. Other content can contain up to 1,024 characters. Chinese characters are not supported.

    Configuration Samples:

    Suppose the Origin URL Rewrite Configuration of the acceleration domain name www.test.com is as follows:

    Then,

    • The origin-pull request www.test.com/test/ will be changed to www.test.com/newtest/.
    • Pull the origin server to request www.test.com/test/a.jpg, www.newtest.com/newtest/a.jpg will be actually requested.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help