Help Center> Object Storage Service> Console Operation Guide> Configuring a Back-to-Source Rule
Updated on 2023-04-26 GMT+08:00

Configuring a Back-to-Source Rule


For details, see Back to Source.

Limitations and Constraints

For details, see Back to Source.

Creating 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 name you want. The Objects page is displayed.
  3. In the navigation pane, choose Back to Source. The back-to-source rule list is displayed.
  4. Click Create.

    Figure 1 Creating a mirroring back-to-source rule

  5. Configure a mirroring back-to-source rule by referring to the parameters listed in Table 1.

    Table 1 Parameters in a mirroring back-to-source rule



    Resource Type

    Type of the resources at the source site (origin server).

    • Public: The origin server data comes from public object storage.
    • Private: The origin server data comes from private object storage of some cloud vendors.

    Back-to-Source Condition

    Conditions that trigger the back-to-source rule.

    A mirroring back-to-source rule is triggered when the following conditions are met: The requested object starts with the specified file name prefix, and an HTTP status code 404 is returned because the object is not found in the bucket.

    Rules for specifying a file name prefix:

    • The specified file name prefix cannot exceed 1023 characters.
    • The specified file name prefix cannot contain or overlap with any other file name prefix specified for an existing rule.
    • If no file name prefix is specified, the rule applies to all files that do not meet the conditions of other back-to-source rules configured for the bucket. A bucket can have only one back-to-source rule that does not have a specified file name prefix.

    For example, if the file name prefix is set to 123/, the rule is triggered when the 123/456.txt file is requested but not available in the bucket.

    Add Prefix or Suffix

    When OBS requests data from the source site, the prefix or suffix is added in front of or after the name of the requested object. However, the object returned to OBS and the client keeps its original name without the added prefix or suffix.

    Example: A client requests abc.txt from OBS, which triggers the back-to-source rule. If the specified prefix is 123, OBS requests 123abc.txt from the source site. However, the object is still downloaded as abc.txt to OBS and then returned to the client.

    Replace Prefix With

    OBS uses the specified prefix to replace the file name prefix set in the back-to-source condition when it requests data from the source site. However, the object returned to the client keeps the original prefix in its name.

    Example: The file name prefix is set to 123 as the back-to-source condition and the replacement prefix is set to abc. When the client requests 123456.txt, the back-to-source rule is triggered. Then OBS requests abc456.txt from the source site. However, the obtained object is still saved as 123456.txt in OBS and returned to the client.

    Source URL

    Source site address. You can set active sites and standby sites.

    The active site address is preferentially used during the back-to-source process. If multiple active site addresses are configured, all active sites are accessed in polling mode. If two or more active site addresses are configured, when the first request to an active address fails and the retry conditions are met, the request will retry another active site address. Configure at least one active site. Up to five active sites are supported. If you fail to retrieve content from all active sites, the request will try standby sites.

    Format: http(https)://source domain name/static path

    • The source domain name is the domain name of the source site.
      • If the source site is a bucket that can be accessed over HTTP, the address is the bucket domain name.
      • If the source site is a private bucket provided by other cloud vendors, the address is the region domain name. At present, only private buckets of some cloud vendors are supported.
    • The static path indicates the directory where the target file resides. For example, if the static path is 123/, the target file is in the 123/ directory.

    Retry Condition

    Condition when a retry is triggered.

    Error codes starting with 4XX and 4 cannot be configured together. Error codes starting with 5XX and 5 cannot be configured together. A maximum of 20 error codes can be configured.

    Carry Request String

    When this function is enabled, query parameters in the request URL are passed to the source site.

    Redirect Request

    When this function is enabled, the request will follow the 3xx redirection response, if redirection is configured for the source site, to fetch the requested resource and save the resource to OBS. A request can follow a maximum of 10 redirections.

    Redirect without Referer

    With this function enabled, if redirection has been configured for the origin server, the Referer header in the request will be filtered out during redirecting.

    HTTP Header Pass Rule

    You can specify the HTTP header parameters that can be passed to the source site when a request sent to OBS triggers the mirroring back-to-source rule. References provides a configuration example and lists the HTTP headers that are not supported.

    • Pass all parameters/Pass specified parameters: Set the HTTP header parameters that can be passed.
    • Do not pass specified parameters: Set the HTTP header parameters that cannot be passed. In this case, OBS does not pass the specified headers to the source site. If a header is specified for both the pass and do-not-pass categories, it is deemed as a do-not-pass parameter.
    • Configure custom parameters: You can set a custom value for a specified header. If a client request carries this header, OBS changes the header value to the custom value before passing it to the source site.

    IAM Agency

    An IAM agency is required to delegate OBS to obtain data from the source site. The agency must grant OBS the Tenant Administrator permission, with an unlimited validity period. If no appropriate IAM agency is available, create one. For details, see Creating an IAM Agency.

  6. Click OK.


Example for configuring an HTTP header pass rule:

Assume that the parameters are set as shown in Figure 2.

Figure 2 Configuring an HTTP header pass rule

Based on the preceding configuration, if the header of the request sent to OBS is as follows:

GET /ObjectName HTTP/1.1 

OBS sends the following request to the source site when the back-to-source rule is triggered:

GET /ObjectName HTTP/1.1 

The following HTTP headers cannot be passed to the source site:

  1. HTTP headers starting with the following prefixes:
    • x-obs-
  2. All standard HTTP headers, for example:
    • Content-Length
    • Authorization2
    • Authorization
    • Range
    • Date