You can configure an origin-pull rule for your bucket through the COS Console. This rule allows you to pull data from another origin for COS to access if the object you request does not exist in your bucket, or a specific request needs to be redirected. The use cases include migrating hot data, redirecting specific requests, and any other scenario you see fit.
The origin-pull success rate depends on your network environment.
prefix, then the origin-pull is triggered when you access
https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/prefix123.jpgand an HTTP status code 404 is returned.
Follow request protocol,
Force HTTPS, and
httpsprefix. You can optionally append a port number to the 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:
Fixed file: specifies a fixed file to which all requests are redirected when the origin-pull rule is triggered.
Specified prefix: specifies the prefix for the file to which a request is redirected when the origin-pull rule is triggered. For example, if the prefix is specified as
test, the request is redirected to the
<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.
Specified suffix: specifies the suffix for the file to which a request is redirected when the origin-pull rule is triggered. For example, if the suffix is specified as
.jpg, the request is redirected to the
<origin-pull address>/prefix123.jpg when 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 by default.
- “Specified prefix” and “Specified suffix” can be used at the same time.
A user whose APPID is 1250000000 created a bucket named "examplebucket-1250000000", and enabled CDN acceleration domain name:
The origin-pull address for the bucket was set to:
picture.jpg was stored at the origin server
Initial access from the client (with sync origin-pull disabled):
When COS finds that the object cannot be hit, it returns HTTP status code
302 and redirects the user to the following address:
Initial access from the client (with sync origin-pull enabled):
When COS finds that the object cannot be hit, it returns a 200 HTTP status code to the client and is redirected to the following URL:
Now, the object is provided by the origin server for access. Meanwhile, COS copies this
picture.jpg from the origin server to the root directory of the bucket
COS directly hits the
picture.jpg object in the root directory and returns it to the client.