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.
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.
You can click Add Rule to add rewrite rules as needed.
/; prefix matching is used by default; 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
https://). You can modify it as needed.
/(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
Suppose the Origin URL Rewrite Configuration of the acceleration domain name
www.test.com is as follows:
The origin-pull URL will be re-written as follows:
www.test.com/images/1.jpgis requested, the request hits the first and third rule. As rules are executed from the bottom to top, the URL will be re-written to
www.test.com/imagesis requested, the request hits the first, second, and third rule. As rules are executed from the bottom to top, the URL will be re-written to