EditOriginUriAndHost

갱신 시간: 2026-08-14 11:22:04

Modify the source URI and host rewrite

  • 한도 설명: accept the port request in xml format and response with xml and json format.
  • 단일 사용자 통화 빈도: 300/5min
  • 해당 상품(제품): APM,Content Acceleration,Dynamic Web Acceleration,Media Acceleration-Live,Media Acceleration VoD,Media Acceleration Live Broadcast,Flood Shield,Flood Shield 2.0
API 인증에 관한 자세한 내용은 다음을 참조하십시오:API 인증 개요

요청 파라미터

Path 파라미터

파라미터 이름설명
*domain-nameString

the domain whoes need query config

Body 파라미터

파라미터 이름설명
*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 <origin-rules-rewrites/>.

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

응답 파라미터

Body 파라미터

파라미터 이름설명
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.

에러 코드

에러 코드(code)설명(message)HTTP 상태 코드설명
0

Success

202Success
26938005

Parameter format error

400Parameter format error
26938017

Request body object transformation exception

400Request body object transformation exception
26938018

Request header format is not supported

400Request header format is not supported
26932001

Domain name not found

404Domain name not found
26932002

Domain name does not belong to the customer

400Domain name does not belong to the customer
26933001

Error DataId

400Error DataId
26935001

No XXXX configuration items are planned for the package

400No XXXX configuration items are planned for the package
26939999

System internal anomaly

500System internal anomaly

예제

JSON
XML
JSON
요청 예제
복사 복사 완료
#!/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":""
        }
    ]
}'
응답 예제
복사 복사 완료
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":""
}
이 문서의 내용이 도움이 되었습니까?
아니오
정상적으로 제출되었습니다.피드백을 주셔서 감사합니다.앞으로도 개선을 위해 노력하겠습니다.