You can configure origin-pull rules for buckets in the COS console. If the object you request does not exist in the bucket, or a specific request needs to be redirected, you can configure origin-pull rules to access corresponding data via COS. Origin-pull configurations are mainly used for hot data migration, redirecting specific requests, and other relevant scenarios.
- The success rate of data origin-pull depends on your network environment.
prefix, origin-pull is triggered when you access
https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/prefix123.jpgand an HTTP status code 404 is returned.
Force HTTP, and
Follow request protocol.
Force HTTP, COS will access the origin using HTTPS or HTTP respectively.
Follow request protocol, COS will access the origin with the protocol used in the request.
httpsprefix. You can also add the port number after the domain name or IP address.
Example of a correct address:
abc.example.com abc.example.com:8080 220.127.116.11 18.104.22.168:8080
You can configure a specific origin-pull address using the following fields:
test, the request is redirected to
<origin-pull address="">/test/prefix123. jpgwhen you access
https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/prefix123.jpg, and the origin-pull rule is triggered.
.jpg, the request is redirected to
<origin-pull address="">/prefix123.jpgwhen you access
https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/prefix123, and the origin-pull rule is triggered.
- If you select
Fixed file, the other fields cannot be used.
Specified suffixcan be used at the same time.
A user whose APPID is 1250000000 created a bucket named "examplebucket-1250000000", and enabled CDN acceleration endpoint domain name:
Configure the origin-pull address of the bucket to be:
Store the image picture.jpg at the origin
First access by client (without sync origin-pull enabled):
When COS finds that the object cannot be hit, it returns HTTP status code
302 to the client and redirects to the following address:
First access by client (with sync origin-pull enabled):
When COS finds that the object cannot be hit, it returns the HTTP status code 200 to the client and redirects to the following address:
The origin then provides the object to the client to ensure access, and COS copies picture.jpg from the origin and saves it to the root directory of the bucket "example".
COS directly hits the picture.jpg object in the root directory and returns it to the client.