Using Mirroring-Based Back to Source to Retrieve Data
Usually, if the data requested by a client using GET is not found in OBS, a 404 error will be returned. To avoid this error, OBS provides back to source that pulls the requested data from the source site (origin server) if it is not found in OBS.
Process of Back to Source by Mirroring
If the data you requested is not found in a bucket that has a back-to-source by mirroring rule configured and the request matches the rule, OBS will pull the data from its origin server and return it to you. This process does not interrupt services. Therefore, you can use this function to seamlessly migrate data from the origin server to OBS without being sensed by users, at low costs. Figure 1 shows the process of back to source by mirroring.

You can further configure a redirection address according to the settings of back to source by mirroring. If OBS fails to obtain resources from the origin server and the redirection rule is matched, OBS will return a 302 status code and a redirection address to the client. The client can directly request resources from the redirection address. Figure 2 shows the redirection process.
Back-to-Source Rules
Item |
Description |
---|---|
Conditions for triggering an origin pull rule |
OBS pulls data from the origin server only when a GetObject request results in a 404 response. |
Rules for naming the retrieved files |
If OBS retrieves a file from the origin server via http(s)://MirrorURL/ObjectName, the file is stored in OBS under the same name, ObjectName. For example, if the source address set for a bucket is https://yun.com and the requested file example.jpg is not found in the bucket, OBS will retrieve the file via https://yun.com/example.jpg and file example.jpg is then pushed to OBS. |
Status code return rules in the case of retrieval failures |
If OBS fails to retrieve a file from the source, it returns 404 to the client by default. |
Rules for updating the retrieved files |
If a file has been pushed by the origin server to OBS through mirroring, OBS does not update the file even if the source file changes. |
HTTP request rules |
By default, headers and query strings included in requests to OBS are not transferred to the origin server. However, you can configure the back to source settings to specify whether they should be passed along. |
Constraints
Category |
Description |
---|---|
Bucket versions |
Only buckets of version 3.0 or later support back to source by mirroring. |
Time |
It takes about five minutes to apply any changes to a back-to-source by mirroring rule. |
Regions |
For the regions that support back to source, see Function Overview. |
Number of rules |
A maximum of 10 back-to-source by mirroring rules can be configured for a bucket. |
Functions |
|
Permissions |
|
Others |
|

Creating a Back-to-Source by Mirroring Rule
You can use OBS Console or APIs to create a mirroring back-to-source rule.
References
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot