EditOriginUriAndHost

Update time: 2026-08-14 11:22:04

Applicable Products

Content Acceleration,Dynamic Web Acceleration,Media Acceleration VoD,Media Acceleration Live Broadcast

API Description

Modify the source URI and host rewrite

Call frequency

Single user trigger frequency: 300/5min

Request parameter(s)

Path Params

NameDescription
*domain-nameString
the domain whoes need query config

Body Params

NameDescription
*originRulesRewritesList
Return path rewrite configuration 1. When you need to set the rewrite configuration of the backsource path, this must be filled in 2. Rewrite configuration for clearing the return path for .
dataIdLong
Add a grid type identifier to represent a specific group of configurations when a customer has multiple groups of configurations. Note: Add grid type identifier: data-id, each group configuration corresponds to a data-id: a. If the customer has passed data-id, specify that modifying one group of configuration items content does not require modifying other group configuration content does not need to be included; B. If the customer enters multiple groups of configuration, some of them have data-id, some have not. If there is transmission, the expression of data-id is used to modify a specific group of configurations, but no expression of data-id is used to add a new group of configurations on the original basis; C. If no data-id is transmitted to the customer, it means that the original configuration is completely covered by this configuration; D. If no configuration parameters are transmitted to the customer, only the domain name and the second level are transmitted. Label, which indicates that clearing this interface corresponds to all configuration of domain name secondary service. (c, D content is consistent with the current solution); e, a gird tag can not be empty, if there is no specific configuration item, then data-id must be filled in, and the value is the actual data-id, indicating the value of clearing this data-id corresponding configuration item;
*pathPatternString
The URL matching mode supports regularization. If all matches are made, the input can be configured as:.*
pathPatternHttpString
The protocol of URL matching mode, which is used with path-pattern, is supported by adding parameters: default is empty, blank is default is to support HTTP and HTTPS protocol before URL matching mode path is needed at the same time; Http: URL matches pattern path with HTTP protocol Https: URL matches pattern path with HTTPS protocol Ignore: URL matching mode path without protocol
exceptPathPatternString
Exceptional URL matching pattern in the same format as path pattern
exceptPathPatternHttpString
Exceptional URL matching mode protocol, which is used in conjunction with except-path-pattern; participation support: default is empty, blank is default is required to support both HTTP and HTTPS protocol before URL matching mode path; Http: URL matches pattern path with HTTP protocol. Https: URL matches pattern path with HTTPS protocol. Ignore: URL matching mode path without protocol.
ignoreLetterCaseString
Ignore case or not: the allowable values are true and false, and the default is Ignore
originInfoString
Back-source information, you can enter IP or domain name. That is, customer source IP or domain name
*priorityString
Represents the priority execution order of the customer's multi-group redirected content. The bigger the number, the higher the priority.
originHostString
Back source host,that support to enter domain names; Example: The backsource host of domain name A configures domain name B. When the A domain name requests the source, the requested URL uses the B domain name instead of the A domain name.
beforeRewritedUriString
Pre-rewrite uri. That is, the original request URI for user access. Support regular configuration
afterRewritedUriString
The rewritten uri, the request URI configured before-rewrited-uri, is retrieved with the rewritten uri. Rewrite the source path. Support regular configuration

Response parameter(s)

Body Params

NameDescription
codeString
Error code. It pops up when the HTTPStatus is not 202, and shows the revoking error type of the current request.
messageString
Response message, and shows as success when it succeeds.
dataString
Response data.

Error code

Error code(code)Description(message)HTTP statusSemantic
0Success202Success
26938005Parameter format error400Parameter format error
26938017Request body object transformation exception400Request body object transformation exception
26938018Request header format is not supported400Request header format is not supported
26932001Domain name not found404Domain name not found
26932002Domain name does not belong to the customer400Domain name does not belong to the customer
26933001Error DataId400Error DataId
26935001No XXXX configuration items are planned for the package400No XXXX configuration items are planned for the package
26939999System internal anomaly500System internal anomaly

Example

JSON
XML
JSON
Request example
Copy Copy success
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://{@apiDomain}/api/config/originrulesrewrites/123344" \
-X "PUT" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-d '{
    "originRulesRewrites":[
        {
            "dataId":"1222",
            "pathPattern":".*",
            "pathPatternHttp":"http",
            "exceptPathPattern":"",
            "exceptPathPatternHttp":"",
            "ignoreLetterCase":"true",
            "originInfo":"127.0.0.1",
            "priority":5,
            "originHost":"b.example.com",
            "beforeRewritedUri":"",
            "afterRewritedUri":""
        }
    ]
}'
Response example
Copy Copy success
HTTP/1.1 202 Accept
Date: Sun, 05 May 2019 09:08:53 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id: 83bbebc7-2c95-47d7
{
    "code":"0",
    "message":"success",
   “data":""
}