Modifying the Full Domain Configuration
Function
This API is used to modify the domain name configuration. You can modify the service type, IPv6, origin protocol, origin URL rewriting, advanced origin, range request, redirect from origin, ETag verification, origin response timeout, origin request header, HTTPS, TLS version, force redirect, HSTS, HTTP/2, OCSP stapling, QUIC, cache rule, status code cache TTL, referer validation, IP ACL, User-Agent ACL, token authentication, remote authentication, IP access frequency, HTTP header, custom error page, smart compression, request rate limiting, video seek, origin SNI, access URL rewriting, and browser cache TTL settings.
URI
PUT /v1.1/cdn/configuration/domains/{domain_name}/configs
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
domain_name |
Yes |
String |
Domain name. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
ID of the enterprise project that the domain name to be modified belongs to. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects.
NOTE:
This parameter is mandatory when you use an IAM user to call this API. Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS). |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
configs |
No |
Configs object |
Configuration items. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
business_type |
No |
String |
Service type:
|
origin_request_header |
No |
Array of OriginRequestHeader objects |
Origin request header settings. Original settings of all headers will be overwritten. When using this API, upload information of all headers. |
http_response_header |
No |
Array of HttpResponseHeader objects |
HTTP header settings. Original settings of all headers will be overwritten. When using this API, upload information of all headers. |
url_auth |
No |
UrlAuth object |
Token authentication. |
https |
No |
HttpPutBody object |
Certificate settings. |
sources |
No |
Array of SourcesConfig objects |
Origin server settings. |
origin_protocol |
No |
String |
Origin protocol. Possible values: follow (same as user requests), http (HTTP, default value), and https (HTTPS). |
origin_follow302_status |
No |
String |
Redirect from origin. Possible values: on (enabled) and off (disabled). |
cache_rules |
No |
Array of CacheRules objects |
Cache rules. |
ip_filter |
No |
IpFilter object |
IP address blacklist or whitelist. |
referer |
No |
RefererConfig object |
Referer validation. |
force_redirect |
No |
ForceRedirectConfig object |
Force redirect. |
compress |
No |
Compress object |
Smart compression. |
ipv6_accelerate |
No |
Integer |
IPv6 settings. Possible values: 1 (enabled) and 0 (disabled). |
error_code_cache |
No |
Array of ErrorCodeCache objects |
Status code cache TTL. |
origin_range_status |
No |
String |
Whether range requests are enabled during origin pull. Possible values: on (enabled) and off (disabled).
NOTE:
To enable range requests during origin pull, the origin server must support range requests, that is, requests with the Range field in the headers. Otherwise, origin pull may fail. |
user_agent_filter |
No |
UserAgentFilter object |
User-Agent blacklist or whitelist settings. |
origin_request_url_rewrite |
No |
Array of OriginRequestUrlRewrite objects |
Rules of rewriting origin request URLs. Up to 20 rules can be configured. |
flexible_origin |
No |
Array of flexibleOrigins objects |
Advanced origins. Up to 20 rules can be configured. |
slice_etag_status |
No |
String |
Whether ETag is verified during origin pull. Possible values: on (yes) and off (no). |
origin_receive_timeout |
No |
Integer |
Origin response timeout. The value ranges from 5 to 60, in seconds. |
remote_auth |
No |
commonRemoteAuth object |
Remote authentication settings. |
video_seek |
No |
videoSeek object |
Video seek settings.
NOTE:
|
request_limit_rules |
No |
Array of RequestLimitRules objects |
Request rate limiting. |
ip_frequency_limit |
No |
IpFrequencyLimit object |
IP access frequency limit. You can limit the number of times that a single IP address accesses a single PoP per second to defend against CC attacks and malicious theft. |
hsts |
No |
Hsts object |
HSTS settings. HSTS forces clients (such as browsers) to use HTTPS to access your server, improving access security. |
quic |
No |
Quic object |
QUIC protocol. |
error_code_redirect_rules |
No |
Array of ErrorCodeRedirectRules objects |
Custom error page. |
sni |
No |
Sni object |
Origin SNI. |
request_url_rewrite |
No |
Array of RequestUrlRewrite objects |
Access URL rewriting. |
browser_cache_rules |
No |
Array of BrowserCacheRules objects |
Browser cache TTL. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Name of an origin request header. The value contains 1 to 64 characters, including letters, digits, and hyphens (-). It must start with a letter. |
value |
No |
String |
Value of the origin request header. This parameter is optional for the delete operation. The value contains 1 to 1,000 characters. Variables, for example, $client_ip and $remote_port, are not supported. |
action |
Yes |
String |
Operation type of the origin request header. Possible values: delete and set. A request header field can only be deleted or set. set: If the header does not exist in the original origin pull request, add the header before setting its value. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
HTTP response header. Possible values: Content-Disposition, Content-Language, Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Max-Age, Access-Control-Expose-Headers, or custom headers. The value contains 1 to 100 characters, including letters, digits, and hyphens (-). It must start with a letter. |
value |
No |
String |
Value of the HTTP response header. This parameter is optional for the delete operation. The value of a custom HTTP response header contains 1 to 1,000 characters, including letters, digits, and special characters such as .-_*#!&+|^~'"/:;,=@?<>. |
action |
Yes |
String |
Operation type of the HTTP response header. The value can be set or delete. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Whether token authentication is enabled. Possible values: on (enabled) and off (disabled). |
type |
No |
String |
Signing method. type_a: method A. type_b: method B. type_c1: method C1. type_c2: method C2. |
expire_time |
No |
Integer |
Expiration time. The value ranges from 0 to 31,536,000, in seconds. |
sign_method |
No |
String |
Encryption algorithm. The value can be md5 or sha256. |
match_type |
No |
String |
Authentication scope. Currently, the value can only be all (all files are authenticated). |
inherit_config |
No |
InheritConfig object |
Authentication inheritance. Add authentication parameters to TS and MP4 files under M3U8/MPD index files, so that the files can be played after authentication succeeds. |
key |
No |
String |
Signing key. The value contains 6 to 32 characters, including letters and digits. |
backup_key |
No |
String |
Secondary key. The value contains 6 to 32 characters, including letters and digits. |
sign_arg |
No |
String |
Authentication parameter. The value contains 1 to 100 characters, including letters, digits, and underscores (_). The value cannot start with a digit. This parameter is mandatory for signing method A or C2. Default value: auth_key. |
time_format |
No |
String |
Time format. dec: decimal. hex: hexadecimal. Method A supports only the decimal format. Method B supports only the decimal format. Method C1 supports only the hexadecimal format. Method C2 supports both decimal and hexadecimal formats. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Whether authentication inheritance is enabled. The options are on (enabled) and off (disabled). |
inherit_type |
No |
String |
Authentication inheritance settings. The value can be m3u8, mpd, or m3u8,mpd.
NOTE:
This parameter is mandatory when authentication inheritance is enabled. |
inherit_time_type |
No |
String |
Time type of the files that inherits authentication settings. sys_time: current system time. parent_url_time: time when a user accesses the M3U8/MPD file.
NOTE:
This parameter is mandatory when authentication inheritance is enabled. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
https_status |
No |
String |
Whether HTTPS is enabled. Possible values: on (enabled) and off (disabled). |
certificate_type |
No |
String |
Certificate type. server indicates an international certificate. |
certificate_source |
No |
Integer |
Certificate source. 0 indicates your own certificate.
NOTE:
This parameter is mandatory when a certificate is configured. |
certificate_name |
No |
String |
Certificate name, which contains 3 to 64 characters.
NOTE:
This parameter is mandatory when a certificate is configured. |
certificate_value |
No |
String |
Content of the certificate used by the HTTPS protocol. This parameter is mandatory when a certificate is configured.
NOTE:
The value must be PEM encoded. |
private_key |
No |
String |
Private key used by the HTTPS protocol. This parameter is mandatory when a certificate is configured.
NOTE:
The value must be PEM encoded. |
http2_status |
No |
String |
Whether HTTP/2 is used. Possible values: on (yes) and off (no).
NOTE:
Default value: off. When https_status is set to off, this parameter does not take effect. |
tls_version |
No |
String |
Transport Layer Security (TLS). Currently, TLS 1.0, TLS 1.1, TLS 1.2, and TLS 1.3 are supported. By default, TLS 1.1, TLS 1.2, and TLS 1.3 are enabled. At least one version must be enabled.
NOTE:
|
ocsp_stapling_status |
No |
String |
Whether Online Certificate Status Protocol (OCSP) stapling is enabled. Possible values: on (yes) and off (no). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
origin_type |
Yes |
String |
Origin server type.
|
origin_addr |
Yes |
String |
IP address or domain name of the origin server. |
priority |
Yes |
Integer |
Origin server priority. Possible values: 70 (primary) and 30 (standby). |
weight |
No |
Integer |
Weight. The value ranges from 1 to 100. |
obs_web_hosting_status |
No |
String |
Whether static website hosting is enabled for the OBS bucket. This parameter is mandatory when the origin server type is obs_bucket. Possible values: off (disabled) and on (enabled). |
http_port |
No |
Integer |
HTTP port. Default value: 80. The port number ranges from 1 to 65535. |
https_port |
No |
Integer |
HTTPS port. Default value: 443. The port number ranges from 1 to 65535. |
host_name |
No |
String |
Host header. The default value is the acceleration domain name. |
obs_bucket_type |
No |
String |
OBS bucket type. This parameter is mandatory when the origin server type is OBS bucket. Default value: public.
|
bucket_access_key |
No |
String |
Access key of the third-party bucket.
NOTE:
This parameter is mandatory when the origin server is a third-party bucket. |
bucket_secret_key |
No |
String |
Secret key of the third-party bucket.
NOTE:
This parameter is mandatory when the origin server is a third-party bucket. |
bucket_region |
No |
String |
Region of the third-party bucket.
NOTE:
This parameter is mandatory when the origin server is a third-party bucket. |
bucket_name |
No |
String |
Name of the third-party bucket.
NOTE:
This parameter is mandatory when the origin server is a third-party bucket. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
match_type |
No |
String |
Match type.
|
match_value |
No |
String |
Cache content based on the cache rule. If match_type is set to all, this parameter is left blank. If match_type is set to file_extension, the value of this parameter is a list of file types. A file type starts with a period (.). File types are separated by commas (,), for example, .jpg,.zip,.exe. Up to 20 file types are supported. If match_type is set to catalog, the value of this parameter is a list of directories. A directory starts with a slash (/). Directories are separated by commas (,), for example, /test/folder01,/test/folder02. Up to 20 directories are supported. If match_type is set to full_path, the value of this parameter is a full path. A full path starts with a slash (/) and supports wildcard characters (*). A cache rule can contain only one full path, for example, /test/index.html or /test/*.jpg. If match_type is set to home_page, this parameter is left blank. |
ttl |
No |
Integer |
Cache TTL. The maximum TTL is 365 days.
NOTE:
The default value is 0. |
ttl_unit |
Yes |
String |
Unit of the cache TTL. Possible values: s (second), m (minute), h (hour), and d (day). |
priority |
Yes |
Integer |
Priority of the cache rule. The default value is 1 and the value ranges from 1 to 100. A larger value indicates a higher priority. The priority of a rule must be unique. |
follow_origin |
No |
String |
Origin cache control status. Possible values: on (enabled) and off (disabled). > The default value is off. |
url_parameter_type |
No |
String |
URL parameters.
|
url_parameter_value |
No |
String |
URL parameters, which are separated by commas (,). Up to 10 parameters can be set. > This parameter is mandatory when url_parameter_type is set to del_params or reserve_params. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
IP ACL type. off: Disable the IP ACL. black: IP address blacklist. white: IP address whitelist. |
value |
No |
String |
IP address blacklist or whitelist. This parameter is optional when type is set to off. A list contains up to 500 IP addresses and IP address segments, which are separated by commas (,). IPv6 addresses are supported. Duplicate IP addresses and IP address segments will be removed. Addresses with wildcard characters are not supported, for example, 192.168.0.*. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Referer validation type. off: Disable referer validation. black: referer blacklist. white: referer whitelist. |
value |
No |
String |
Domain names or IP addresses, which are separated by commas (,). Wildcard domain names and domain names with port numbers are supported. Enter up to 400 domain names and IP addresses. The port number ranges from 1 to 65535. |
include_empty |
No |
Boolean |
Whether blank referers are included. A referer blacklist including blank referers indicates that requests without any referers are not allowed to access. A referer whitelist including blank referers indicates that requests without any referers are allowed to access. Possible values: true (included) and false (default value, excluded). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Whether force redirect is enabled. Possible values: on (enabled) and off (disabled). |
type |
No |
String |
Force redirect type. Possible values: http (force redirect to HTTP) and https (force redirect to HTTPS). |
redirect_code |
No |
Integer |
Redirect status code 301 or 302. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Whether smart compression is enabled. Possible values: on (enabled) and off (disabled). |
type |
No |
String |
Smart compression type. Possible values: gzip (gzip) and br (Brotli). |
file_type |
No |
String |
Formats of files to be compressed. Enter up to 200 characters. Multiple formats are separated by commas (,). Each format contains up to 50 characters. The default value is .js,.html,.css,.xml,.json,.shtml,.htm when smart compression is used for the first time. When this function is used again and this value is left empty, the result of the previous setting is used. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
code |
No |
Integer |
Supported error codes, including 301, 302, 400, 403, 404, 405, 414, 500, 501, 502, 503, and 504. |
ttl |
No |
Integer |
Error code cache TTL, in seconds. The value ranges from 0 to 31,536,000 (365 days each year by default).
NOTE:
The cache TTL of 3XX status codes ranges from 0s to 20s. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
User-Agent blacklist or whitelist type. off: The User-Agent blacklist/whitelist is disabled. black: User-Agent blacklist. white: User-Agent whitelist. |
value |
No |
String |
User-Agent blacklist or whitelist. This parameter is optional when type is set to off. Up to 10 rules can be configured. A single rule contains up to 100 characters. Rules are separated by commas (,). |
ua_list |
No |
Array of strings |
User-Agent blacklist or whitelist. This parameter is optional when type is set to off. Up to 10 rules can be configured. A rule contains up to 100 characters. When ua_list and value are both set, ua_list is used. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
priority |
Yes |
Integer |
Priority of a URL rewrite rule. The priority of a rule is mandatory and must be unique. The rule with the highest priority will be used for matching first. Enter an integer ranging from 1 to 100. A greater number indicates a higher priority. |
match_type |
Yes |
String |
Match type. all: all files. file_path: URI path. wildcard full_path |
source_url |
No |
String |
URI to be rewritten. A URI starts with a slash (/) and does not contain http://, https://, or the domain name. The value contains up to 512 characters. Wildcards (*) are supported, for example, /test/*/*.mp4. If the match mode is set to all files, parameters cannot be configured. |
target_url |
Yes |
String |
A URI starts with a slash (/) and does not contain http://, https://, or the domain name. The value contains up to 256 characters. The nth wildcard (*) field can be substituted with $n, where n = 1, 2, 3..., for example, /newtest/$1/$2.jpg. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
match_type |
Yes |
String |
URI match mode. The value can be file_extension or file_path. |
match_pattern |
Yes |
String |
file_extension: All file types are supported. A file type starts with a period (.). File types are separated by semicolons (;). Up to 20 file types are supported. file_path: A path starts with a slash (/). Paths are separated by semicolons (;). Up to 20 paths are supported. |
priority |
Yes |
Integer |
The priority value ranges from 1 to 100. The larger the value, the higher the priority. |
back_sources |
Yes |
Array of backSources objects |
Origin information.
NOTE:
Only one origin server is allowed in each directory. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sources_type |
Yes |
String |
Origin server type. Possible values: ipaddr (IP address), domain (domain name), and obs_bucket (OBS bucket). |
ip_or_domain |
Yes |
String |
IP address or domain name of the origin server. |
obs_bucket_type |
No |
String |
OBS bucket type.
|
http_port |
No |
Integer |
HTTP port. Value range: 1 to 65535. Default value: 80. |
https_port |
No |
Integer |
HTTPS port. Value range: 1 to 65535. Default value: 443. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
remote_authentication |
Yes |
String |
Whether remote authentication is enabled. Possible values: on (enabled) and off (disabled). |
remote_auth_rules |
Yes |
RemoteAuthRule object |
Remote authentication settings. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
auth_server |
Yes |
String |
Address of a reachable authentication server. The URL must contain http:// or https://. The address cannot be a local address such as localhost or 127.0.0.1. The address cannot be an acceleration domain name added on CDN. |
request_method |
Yes |
String |
Request method supported by the authentication server. GET, POST, and HEAD are supported. |
file_type_setting |
Yes |
String |
all: Requests for all files are authenticated. specific_file: Requests for files of specific types are authenticated. Example: jpg|MP4 File types are case insensitive. For example, jpg and JPG indicate the same file type. File types are separated by vertical bars (|). |
specified_file_type |
No |
String |
The value contains up to 512 characters. This parameter is mandatory when file_type_setting is set to specific_file. In other cases, this parameter is left blank. The value contains letters and digits. File types are separated by vertical bars (|), for example, jpg|mp4. This field is verified only when it is mandatory. |
reserve_args_setting |
Yes |
String |
Parameters that need to be authenticated in user requests. The options are reserve_all_args (retain all URL parameters), reserve_specific_args (retain specified URL parameters), and ignore_all_args (ignore all URL parameters). |
reserve_args |
No |
String |
This parameter is mandatory when reserve_args_setting is set to reserve_specific_args. In other cases, this parameter is left blank. Parameters are separated by vertical bars (|), for example, key1|key2. |
add_custom_args_rules |
No |
Array of customArgs objects |
Token authentication parameters. |
reserve_headers_setting |
Yes |
String |
Headers to be authenticated in user requests. The options are reserve_all_headers (retain all request headers), reserve_specific_headers (retain specified request headers), and ignore_all_headers (ignore all request headers). |
add_custom_headers_rules |
No |
Array of customArgs objects |
Request header authentication parameters. |
auth_success_status |
Yes |
String |
Status code returned by the remote authentication server to CDN PoPs when authentication is successful. Value range: 2xx and 3xx. |
auth_failed_status |
Yes |
String |
Status code returned by the remote authentication server to CDN PoPs when authentication fails. Value range: 4xx and 5xx. |
response_status |
Yes |
String |
Status code returned by CDN PoPs to users when authentication fails. Value range: 2xx, 3xx, 4xx, and 5xx. |
timeout |
Yes |
Integer |
Authentication timeout interval, that is, the interval from the time when a CDN PoP forwards an authentication request to the time when the CDN PoP receives the result returned by the remote authentication server. Enter 0 or a value ranging from 50 to 3,000. The unit is millisecond. |
timeout_action |
Yes |
String |
Method used by CDN PoPs to process a user request after authentication times out. pass: The user request is allowed and the corresponding resource is returned after the authentication times out. forbid: The user request is rejected after the authentication times out and the configured status code is returned to the user. |
reserve_headers |
No |
String |
This parameter is mandatory when reserve_headers_setting is set to reserve_specific_headers. In other cases, this parameter is left blank. Request headers are separated by vertical bars (|), for example, key1|key2. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Parameter type. Possible values: custom_var (custom) and nginx_preset_var (preset). |
key |
Yes |
String |
Parameter, which containing 1 to 256 characters. Only letters, digits, and the following special characters are allowed: ._-*#%|+^@?= |
value |
Yes |
String |
When type is set to custom_var, the value contains 1 to 256 characters. Only letters, digits, and the following special characters are allowed: ._-*#%|+^@?= When type is set to nginx_preset_var, the value can only be set to $http_host, $http_user_agent, $http_referer, $http_x_forwarded_for, $http_content_type, $remote_addr, $scheme, $server_protocol, $request_uri, $uri, $args, and $request_method. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable_video_seek |
Yes |
Boolean |
Video seek status. true: enabled; false: disabled.
NOTE:
When this parameter is set to false, the API for querying domain name configuration does not return the video seek setting information. |
enable_flv_by_time_seek |
No |
Boolean |
Time-based FLV seek status. true: enabled; false: disabled. |
start_parameter |
No |
String |
Video playback start parameter in user request URLs. The value contains up to 64 characters. Only letters, digits, and underscores (_) are allowed. |
end_parameter |
No |
String |
Video playback end parameter in user request URLs. The value contains up to 64 characters. Only letters, digits, and underscores (_) are allowed. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
No |
String |
Status. The value can only be on.
NOTE:
If request_limit_rules is left empty, request rate limiting is disabled. This parameter is used in earlier APIs and will be deprecated. |
priority |
Yes |
Integer |
Priority. A larger value indicates a higher priority. The value ranges from 1 to 100. The value must be unique. |
match_type |
Yes |
String |
Match type. The options are all (all files) and catalog (directory). |
match_value |
No |
String |
Match type value. When match_type is set to all, leave this parameter empty. When match_type is set to catalog, the value is a directory address starting with a slash (/), for example, /test.
NOTE:
This parameter is mandatory when match_type is set to catalog. |
type |
Yes |
String |
Rate limit mode. Currently, only rate limit by traffic is supported. This parameter can only be set to size. |
limit_rate_after |
Yes |
Long |
Rate limiting condition. type=size,limit_rate_after=50 indicates that the speed is limited to the value of limit_rate_value after 50 bytes are transmitted. Unit: byte. Value range: 0 to 1,073,741,824. |
limit_rate_value |
Yes |
Integer |
Rate limit, in bit/s. The value ranges from 0 to 104,857,600. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Status. The options are on (enabled) and off (disabled). |
qps |
No |
Integer |
Access threshold, in times/second. The value ranges from 1 to 100,000.
NOTE:
This parameter is mandatory when IP access frequency is enabled. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Status. The options are on (enabled) and off (disabled). |
max_age |
No |
Integer |
Expiration time, that is, the TTL of the response header Strict-Transport-Security on the client. Unit: second. Value range: 0 to 63,072,000.
NOTE:
This parameter is mandatory when status is set to on. |
include_subdomains |
No |
String |
Whether subdomain names are included. The options are on (included) and off (not included).
NOTE:
This parameter is mandatory when status is set to on. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Status. The options are on (enabled) and off (disabled). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
error_code |
Yes |
Integer |
Redirect error code. Currently, the following status codes are supported: 4xx: 400, 403, 404, 405, 414, 416, and 451 5xx: 500, 501, 502, 503, and 504 |
target_code |
Yes |
Integer |
Redirect status code. The value can be 301 or 302. |
target_link |
Yes |
String |
Destination URL. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
status |
Yes |
String |
Origin SNI status. Possible values: on (enabled) and off (disabled). |
server_name |
No |
String |
Origin domain name to be accessed when CDN pulls origin content, for example, test.example.com.
NOTE:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
condition |
Yes |
UrlRewriteCondition object |
Match condition. |
redirect_status_code |
No |
Integer |
Redirect status code. 301, 302, 303, and 307 are supported. |
redirect_url |
Yes |
String |
Redirect URL. Target URL. A URL starts with a slash (/) and does not contain http://, https://, or the domain name. Example: /test/index.html
|
redirect_host |
No |
String |
Domain name to which client requests are redirected.
NOTE:
By default, the acceleration domain name is used. The value contains 1 to 255 characters and starts with http:// or https://, for example, http://www.example.com. |
execution_mode |
Yes |
String |
Execution rule.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
match_type |
Yes |
String |
Match type.
|
match_value |
Yes |
String |
Match content. If match_type is set to catalog, the value of this parameter is a list of directories. A directory starts with a slash (/). Directories are separated by commas (,), for example, /test/folder01,/test/folder02. Up to 20 directories are supported. If match_type is set to full_path, the value of this parameter is a full path. A full path starts with a slash (/) and supports wildcard characters (*). A cache rule can contain only one full path, for example, /test/index.html or /test/*.jpg. |
priority |
Yes |
Integer |
Priority of the access URL rewrite rule. Enter an integer ranging from 1 to 100. A greater number indicates a higher priority. Each rule must have a unique priority. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
condition |
Yes |
BrowserCacheRulesCondition object |
Match condition. |
cache_type |
Yes |
String |
Cache effective type.
|
ttl |
No |
Integer |
Cache TTL. The maximum TTL is 365 days.
NOTE:
This parameter is mandatory when the cache effective type is set to ttl. |
ttl_unit |
No |
String |
Unit of the cache TTL. Possible values: s (second), m (minute), h (hour), and d (day).
NOTE:
This parameter is mandatory when the cache effective type is set to ttl. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
match_type |
Yes |
String |
Match type.
|
match_value |
No |
String |
Cache content based on the cache rule. If match_type is set to all, this parameter is left blank. If match_type is set to file_extension, the value of this parameter is a list of file types. A file type starts with a period (.). File types are separated by commas (,), for example, .jpg,.zip,.exe. Up to 20 file types are supported. If match_type is set to catalog, the value of this parameter is a list of directories. A directory starts with a slash (/). Directories are separated by commas (,), for example, /test/folder01,/test/folder02. Up to 20 directories are supported. If match_type is set to full_path, the value of this parameter is a full path. A full path starts with a slash (/) and supports wildcard characters (*), but cannot end with a wildcard (*). A wildcard (*) can only follow the last slash (/). A cache rule can contain only one full path, for example, /test/index.html or /test/*.jpg. If match_type is set to home_page, this parameter is left blank. |
priority |
Yes |
Integer |
Priority of the rule. Enter an integer ranging from 1 to 100. A greater number indicates a higher priority. Each rule must have a unique priority. |
Response Parameters
None
Example Requests
PUT https://cdn.myhuaweicloud.eu/v1.1/cdn/configuration/domains/www.example.com/configs { "configs" : { "origin_request_header" : [ { "name" : "test-name", "value" : "test_value", "action" : "set" } ], "http_response_header" : [ { "name" : "test-name", "value" : "test_value", "action" : "set" } ], "url_auth" : { "status" : "off" }, "compress" : { "status" : "off" }, "force_redirect" : { "status" : "on", "type" : "http", "redirect_code" : 301 }, "origin_protocol" : "follow", "referer" : { "type" : "black", "value" : "192.168.0.0", "include_empty" : true }, "ip_filter" : { "type" : "black", "value" : "192.168.0.0" }, "origin_follow302_status" : "off", "cache_rules" : [ { "match_type" : "file_extension", "match_value" : ".zip", "ttl" : 0, "ttl_unit" : "h", "priority" : 10, "follow_origin" : "off", "url_parameter_type" : "del_params", "url_parameter_value" : "test_param" } ], "sources" : [ { "origin_addr" : "www.example.com", "origin_type" : "domain", "priority" : 70, "http_port" : 80, "https_port" : 443 } ], "flexible_origin" : [ { "priority" : 1, "match_type" : "file_path", "match_pattern" : "/test", "back_sources" : [ { "sources_type" : "domain", "ip_or_domain" : "www.back.example.com" } ] } ], "slice_etag_status" : "off", "ipv6_accelerate" : 1, "origin_receive_timeout" : 30, "remote_auth" : { "remote_authentication" : "on", "remote_auth_rules" : { "auth_server" : "https://192.168.0.0", "request_method" : "GET", "file_type_setting" : "all", "reserve_args_setting" : "reserve_all_args", "reserve_headers_setting" : "reserve_specific_headers", "auth_success_status" : "200", "auth_failed_status" : "403", "response_status" : "403", "timeout" : 500, "timeout_action" : "pass", "reserve_headers" : "sf", "add_custom_args_rules" : [ { "type" : "nginx_preset_var", "key" : "http_host", "value" : "$http_host" } ], "add_custom_headers_rules" : [ { "type" : "nginx_preset_var", "key" : "http_host", "value" : "$http_host" } ] } }, "video_seek" : { "enable_video_seek" : true, "enable_flv_by_time_seek" : true, "start_parameter" : "start", "end_parameter" : "end" }, "request_limit_rules" : [ { "status" : "on", "match_type" : "catalog", "match_value" : "/test", "type" : "size", "limit_rate_after" : 1024, "limit_rate_value" : 50, "priority" : 88 } ], "sni" : { "status" : "on", "server_name" : "test.example.com" }, "request_url_rewrite" : [ { "condition" : { "match_type" : "full_path", "match_value" : "/test/*.jpg", "priority" : 10 }, "redirect_status_code" : 301, "redirect_url" : "/test/index.html", "redirect_host" : "http://www.example.com", "execution_mode" : "redirect" } ], "browser_cache_rules" : [ { "condition" : { "match_type" : "full_path", "match_value" : "/test/*.jpg", "priority" : 10 }, "cache_type" : "ttl", "ttl" : 20, "ttl_unit" : "h" } ] } }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
204 |
Request succeeded. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.