Updated on 2025-08-04 GMT+08:00

Back to Source

Usually, if the data you requested is not found in OBS, a 404 error will be returned. However, with back to source, OBS pulls the requested data from the source site (origin server) instead.

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 back to source by mirroring to seamlessly migrate data from the origin server to OBS. The migration incurs minimal cost and has no noticeable impact. Figure 1 shows the process of back to source by mirroring.

Figure 1 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.

Figure 2 Process of redirecting a request

Constraints

Bucket versions

  • Only buckets whose version is 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

Back to source is only available in some regions. For details, see Function Overview.

Number of rules

  • A maximum of 10 back-to-source by mirroring rules can be configured for a bucket.

Functions

  • Anonymous users are not allowed to configure back-to-source by mirroring rules.
  • Parallel file systems do not support back-to-source by mirroring rules.
  • Static website hosting does not support back to source by mirroring. Specifically, if 404 is returned when you use a static website domain name to download an object, back to source by mirroring will not be triggered.
  • The bucket, to which a back-to-source rule is configured, cannot be specified as the source site.
  • Currently, back to source by mirroring from private buckets is only supported for some cloud vendors.
  • The origin server cannot transfer data in Transfer-Encoding: chunked mode. That is, the response to the request for downloading an object from the origin server must contain the Content-Length header to specify the size of the source object.

    Specifically, in the Create/Edit Back-to-Source Rule window, you cannot specify Accept-Encoding for Do not pass specified parameters under the Pass all parameters option of HTTP Header Pass Rule.

    Figure 3 Configuration method

Permissions

  • To configure, obtain, or delete back-to-source by mirroring rules, you must have the Tenant Administrator permission assigned by using IAM.
  • Back to source by mirroring requires that you create an IAM agency to delegate OBS to pull data from its origin server. The permissions the agency should assign to OBS include obs:object:PutObject, obs:object:GetObject, obs:bucket:ListBucket, and obs:object:AbortMultipartUpload.
  • If SSE-KMS is enabled for a bucket, the kms:cmk:get, kms:cmk:list, kms:cmk:create, kms:dek:create, kms:dek:crypto, and kms:dek:crypto permissions must be configured for the IAM agency for OBS.

Others

  • Back to source by mirroring is free now.
  • An object cannot match two different mirroring back-to-source rules.

Creating a Back-to-Source by Mirroring Rule

You can create back-to-source by mirroring rules on OBS Console or by making API calls.