Set HTTPS Acceleration
Last Updated:2020-09-17
Interface
This interface is used to set HTTPS acceleration related options, and it is a full configuration interface.
Method | Path | Description |
---|---|---|
PUT | /v2/abroad/domain/{domain}/config?https | Configure HTTPS acceleration |
domain: CDN accelerated domain name.
Request body
Parameter | Optional | Type | Description |
---|---|---|---|
https | Required | HTTPSConfig | HTTPS configuration information |
The HTTPSConfig types are as follows:
Parameter | Optional | Type | Description |
---|---|---|---|
enabled | Required | Bool | Enable HTTPS acceleration, and the default is false. When enabled=false, the following fields are invalid. |
certId | Optional | String | When enabled=true, it is required and is the certificate ID returned for SSL certificate service |
httpRedirect | Optional | Bool | When it is true, redirect HTTP requests to HTTPS (The redirect status code is 301) |
http2Enabled | Optional | Bool | Enable HTTP2 feature, and the default is true. When enabled=false, this item is invalid. |
httpOrigin | Optional | Bool | When it is true, forward to origin with HTTP protocol, and the default is false. When enabled=false, this item is invalid. |
Response code (Http Status Code)
HTTP Status Code | Description |
---|---|
200 | Success |
400 | Update failures, parameter errors, etc. |
Request example 1
Enable HTTPS, certId is “ssl-82fdaufdsaldsuaow ", and other properties follow the default values.
PUT /v2/abroad/domain/www.example.com/config?https HTTP/1.1
Host: cdn.baidubce.com
Content-Length: 59
Content-Type: text/json;utf-8
{
"https": {
"enabled": true,
"certId": "ssl-82fdaufdsaldsuaow"
}
}
Request example 2
Enable HTTPS, certId is “ssl-82fdaufdsaldsuaow ", redirect HTTP requests to HTTPS, and the redirection status code is 301. Disable HTTP2 feature, and configure https origin.
PUT /v2/abroad/domain/www.example.com/config?https HTTP/1.1
Host: cdn.baidubce.com
Content-Length: 123
Content-Type: text/json;utf-8
{
"https":{
"enabled":true,
"certId":"ssl-82fdaufdsaldsuaow",
"httpRedirect":true,
"http2Enabled":false,
"httpOrigin": false
}
}
Request example 3
Disable HTTPS. Other options are meaningless.
PUT /v2/abroad/domain/www.example.com/config?https HTTP/1.1
Host: cdn.baidubce.com
Content-Length: 27
Content-Type: text/json;utf-8
{
"https":{
"enabled": false
}
}
Response example
HTTP/1.1 200 OK
Server: nginx
Date: May, 15 May 2020 05:57:29 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
x-bce-request-id: 8a9c4d38-5198-ed4e-b279-272fdde46e4b
{
"status":"RUNNING"
}