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.
Note:
- 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.jpg
and an HTTP status code 404 is returned.Force HTTPS
, Force HTTP
, and Follow request protocol
.Force HTTPS
or 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.http://
or https
prefix. 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
202.96.128.86
202.96.128.86:8080
You can configure a specific origin-pull address using the following fields:
test
, the request is redirected to <origin-pull address="">/test/prefix123. jpg
when 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.jpg
when you access https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/prefix123
, and the origin-pull rule is triggered.Note:
- If you select
Fixed file
, the other fields cannot be used.Specified prefix
andSpecified suffix
can be used at the same time.
Background
A user whose APPID is 1250000000 created a bucket named "examplebucket-1250000000", and enabled CDN acceleration endpoint domain name:
examplebucket-1250000000.file.myqcloud.com
Configure the origin-pull address of the bucket to be:
abc.example.com
Store the image picture.jpg at the origin http://abc.example.com
.
First access by client (without sync origin-pull enabled):
http://examplebucket-1250000000.file.myqcloud.com/picture.jpg
When COS finds that the object cannot be hit, it returns HTTP status code 302
to the client and redirects to the following address:
http://abc.example.com/picture.jpg
First access by client (with sync origin-pull enabled):
http://examplebucket-1250000000.file.myqcloud.com/picture.jpg
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:
http://abc.example.com/picture.jpg
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".
Second-time access:
http://examplebucket-1250000000.file.myqcloud.com/picture.jpg
COS directly hits the picture.jpg object in the root directory and returns it to the client.
Was this page helpful?