Updated on 2024-10-24 GMT+08:00

Back to Source

When a client does not access the requested data in OBS, the 404 error is returned. However, OBS provides the back-to-source function to help you obtain the requested data from its source site if it is not found in OBS.

Back-to-Source by Mirroring

If a mirroring back-to-source rule is configured for an OBS bucket and the requested data is not found in the bucket, the system will retrieve the data, when the back-to-source rule applies to the data, from the origin server, upload it to the bucket, and then return it to the requesting client. This process does not interrupt services. Therefore, you can use this function to seamlessly migrate data from the origin server to OBS, or migrate services to OBS without being sensed by users, at low costs. Figure 1 illustrates the mirroring back-to-source process.

Figure 1 Back-to-source by mirroring

Constraints

Bucket version:

  • Only buckets of version 3.0 and later support the mirroring back-to-source function.

Time:

  • Any changes to a mirroring back-to-source rule take about five minutes to take effect.

Regions

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

Rule count:

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

Function:

  • Anonymous users cannot configure mirroring back-to-source rules for a bucket.
  • Parallel file systems do not support mirroring back-to-source rules.
  • Static website hosting does not support the mirroring back-to-source function.
  • A bucket cannot mirror itself.
  • Currently, mirroring back to source from private buckets is supported for only some cloud vendors.
  • A source cannot transfer data in Transfer-Encoding: chunked mode. The response to the request for downloading an object from the source must contain the Content-Length header to specify the size of the source object.

    To forbid Transfer-Encoding: chunked, in the Create/Edit Back-to-Source Rule window, specify Accept-Encoding for Do not pass specified parameters under the Pass all parameters option of HTTP Header Pass Rule.

    Figure 2 Configuration method
  • If Ngnix was deployed as a reverse proxy for your origin server, turn off chunked_transfer_encoding of Ngnix.
    location / {
         chunked_transfer_encoding off;
    }

Permissions:

  • To configure, obtain, or delete mirroring back-to-source rules, you must have the Tenant Administrator permission assigned by using IAM.
  • Mirroring-based back to source 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.

Other:

  • The mirroring back-to-source function is free.
  • An object cannot match two different mirroring back-to-source rules.

Creating a Mirroring Back-to-Source Rule

You can use OBS Console or APIs to create a mirroring back-to-source rule.

Replicating Mirroring Back-to-Source Rules

You can only use OBS Console to replicate a mirroring back-to-source rule.

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket you want to operate. The Objects page is displayed.
  3. In the navigation pane, choose Back to Source. The back-to-source rule list is displayed.
  4. Click Replicate.
  5. Select a replication source, which is bucket whose back-to-source rules you want to replicate.

    • The back-to-source rules replicated from a source bucket will not overwrite existing rules in the destination bucket, and any that conflict with the existing ones will not be replicated.
    • The version of both source and destination buckets must be 3.0.
    • Before replication, you can change the source URL. For the source URL configuration, see Table 1.
    • You can remove the rules that you do not want to replicate.
    • There can be five back-to-source rules at most in a bucket. If the number of rules you will replicate plus the number of existing rules in the destination bucket exceeds five, the replication will fail. Before replicating the rules, delete some if necessary.
    Figure 4 Replicating back-to-source rules

  6. Click OK to replicate the rules to the destination bucket.

References