Element | Type | Example | Description |
Redirect | Container | N/A | The operation to perform after the rule is matched. Parent nodes: RoutingRule |
RedirectType | String | Mirror | The redirection type. Mirror: mirroring-based back-to-origin. External: external redirection. Object Storage Service (OSS) returns the 3xx HTTP redirect code and the Location header for you to redirect the access to another IP address. AliCDN: redirection based on Alibaba Cloud Content Delivery Network (CDN). OSS adds an additional header to the request, which is different from the External type. After CDN identifies the header, CDN redirects the access to the specified IP address and returns the obtained data instead of the redirect request to the user.
Parent nodes: Redirect |
PassQueryString | Boolean | false | Indicates whether the request parameters of the original request are included in the redirect request when the system runs the redirection rule or mirroring-based back-to-origin rule. If the PassQueryString parameter is set to true and "?a=b&c=d" is included in a request sent to OSS, this parameter is added to the Location header when the redirection mode is 302. For example, if the request contains "Location: www.example.com?a=b&c=d" and the value of RedirectType is Mirror, the a=b&c=d parameter is included in the back-to-origin request. Default value: false Parent nodes: Redirect |
MirrorURL | String | http://example.com | The origin URL for mirroring-based back-to-origin. This element takes effect only when the value of RedirectType is Mirror. The origin URL must start with http:// or https:// and end with a forward slash (/). OSS adds an object name to the end of the URL to generate a back-to-origin URL. For example, the name of the object to access is myobject. If MirrorURL is set to http://example.com/ , the back-to-origin URL is http://example.com/myobject . If MirrorURL is set to http://example.com/dir1/ , the back-to-origin URL is http://example.com/dir1/myobject . Parent nodes: Redirect |
MirrorPassQueryString | Boolean | false | This element plays the same role as PassQueryString and has a higher priority than PassQueryString. This element takes effect only when the value of RedirectType is Mirror. Default value: false Parent nodes: Redirect |
MirrorFollowRedirect | Boolean | true | Indicates whether the access is redirected to the address specified by Location if the origin returns a 3xx HTTP status code. This element takes effect only when the value of RedirectType is Mirror. For example, when a mirroring-based back-to-origin request is initiated, the origin returns 302 and Location is specified. true: OSS continues to request the address specified by Location. The access can be redirected up to 10 times. After 10 times, an error message is returned. false: OSS returns 302 and passes through Location.
Default value: true Parent nodes: Redirect |
MirrorCheckMd5 | Boolean | false | Indicates whether OSS checks the MD5 hash of the body of the response returned by the origin. This element takes effect only when the value of RedirectType is Mirror. When the value of this parameter is true and the response returned by the origin includes the Content-Md5 header, OSS checks whether the MD5 hash of the obtained data matches the header value. If the MD5 hash of the obtained data does not match the header value, OSS does not store the data. Default value: false Parent nodes: Redirect |
MirrorHeaders | Container | N/A | The headers that are included when a mirroring-based back-to-origin rule is specified for the bucket. This element takes effect only when the value of RedirectType is Mirror. Parent nodes: Redirect |
PassAll | Boolean | true | Indicates whether OSS passes through all request headers to the origin. The request headers exclude reserved headers and headers that start with oss-, x-oss-, and x-drs- . This element takes effect only when the value of RedirectType is Mirror. Default value: false Parent nodes: MirrorHeaders |
Pass | String | myheader-key1 | The header to pass through to the origin. This element takes effect only when the value of RedirectType is Mirror. The header can be up to 1,024 bytes in length and can contain only letters, digits, and hyphens (-). You can specify up to 10 Pass headers. Parent nodes: MirrorHeaders |
Remove | String | myheader-key3 | The header that is not allowed to pass through to the origin. Up to 10 Remove headers can be specified. This element is used together with PassAll. The header can be up to 1,024 bytes in length. The character set of this parameter is the same as that of Pass. This element takes effect only when the value of RedirectType is Mirror. Parent nodes: MirrorHeaders |
Set | Container | N/A | Indicates the headers that are sent to the origin. The specified headers are configured in the data returned by the origin regardless of whether the headers are contained in the request. Up to 10 Set containers can be specified. This element takes effect only when the value of RedirectType is Mirror. Parent nodes: MirrorHeaders |
Key | String | myheader-key5 | The key of the header. The key can be up to 1,024 bytes in length. The character set of this parameter is the same as that of Pass. This element takes effect only when the value of RedirectType is Mirror. Parent nodes: Set |
Value | String | myheader-value5 | The value of the header. The value can be up to 1,024 bytes in length and cannot contain "\r\n". This element takes effect only when the value of RedirectType is Mirror. Parent nodes: Set |
Protocol | String | http | The protocol used to redirect the access. This element takes effect only when the value of RedirectType is External or AliCDN. For example, if you access an object named test, Protocol is set to https, and Hostname is set to example.com , the Location header value is https://example.com/test . Valid values: http and https. Parent nodes: Redirect |
HostName | String | example.com | The domain name used for redirection, which must comply with the naming conventions for domain names. This element takes effect only when the value of RedirectType is External or AliCDN. For example, if you access the object named test, Protocol is set to https, and Hostname is set to example.com , the Location header is https://www.example.com/test . Parent nodes: Redirect |
HttpRedirectCode | HTTP status code | 301 | The HTTP redirect code in the response. This element takes effect only when the value of RedirectType is External or AliCDN. Valid values: 301, 302, and 307 Parent nodes: Redirect |
ReplaceKeyPrefixWith | String | def/ | The string used to replace the prefix of the object name in the redirect request. This element takes effect only when the value of RedirectType is External or AliCDN. For example, if you access an object named abc/test.txt and ReplaceKeyPrefixWith is set to def/ , the value of the Location header varies based on whether the value of KeyPrefixEquals is empty. If the value of KeyPrefixEquals is set to abc/ , the Location header value is http://example.com/def/test.txt . If KeyPrefixEquals is empty, the Location header value is http://example.com/def/abc/test.txt .
Parent nodes: Redirect |
ReplaceKeyWith | String | prefix/${key}.suffix | The string used to replace the object name in the redirect request. This element takes effect only when the value of RedirectType is External or AliCDN. This element supports the ${key} variable, which indicates the object name in the request. For example, if you access an object named test and ReplaceKeyWith is set to prefix/${key}.suffix , the Location header value is http://example.com/prefix/test.suffix . Parent nodes: Redirect |