Mirroring-based back-to-origin is used to seamlessly migrate data to OSS. This feature allows you to migrate a service that already runs on an origin that you create or on another cloud service to OSS without service interruptions. You can use mirroring-based back-to-origin rules during migration to obtain the data that is not migrated to OSS. This ensures service continuity.
When a requester accesses an object in the specified bucket but the object does not exist, you can specify the URL of the object in the origin and back-to-origin conditions to obtain the object. For example, you have a bucket named example that is located in the China (Hangzhou) region. You want your requester to obtain the required object in the examplefolder folder from
https://www.example.com/ when the requester accesses the object that does not exist in the examplefolder folder of the bucket root folder. To configure a back-to-origin rule, perform the following steps:
- Log on to the OSS console.
- Click Buckets, and then click the name of the target bucket.
- In the left-side navigation pane, choose .
- Click Configure. Click Create Rule.
- In the Create Rule panel, set Mode to Mirroring.
- Configure Prerequisites and Origin URL.
Parameter Description Prerequisite Select File Name Prefix, and then set File Name Prefix to examplefolder/.Note File Name Prefix and File Name Suffix are optional. When you configure multiple back-to-origin rules, you must set different file name prefixes or suffixes to differentiate back-to-origin rules. Origin URL Set the first column to https, the second column to www.example.com, and the third column to examplefolder.
- Click OK.
Access process after the back-to-origin rule is configured:
- A requester accesses
https://examplebucket.oss-cn-hangzhou.aliyuncs.com/examplefolder/example.txtfor the first time.
- If the examplefolder/example.txt object does not exist in examplebucket, OSS sends a request to
- If the required object is obtained, OSS writes the example.txt object to the examplefolder folder in examplebucket and then returns the object to the requester. If the required object is not obtained, HTTP status code 404 is returned to the requester.
- A requester accesses
For more information about mirroring-based back-to-origin and some special scenarios, see Special configurations of mirroring-based back-to-origin.