Files
notes/work/移动杭研/开发记录/6.11.1/联调记录-高级配置.md
T
2026-03-01 01:43:46 +08:00

305 lines
11 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
| 请求参数 | selfserviceDomainConfig 对应的属性 | 名称 |
| ----------------------------- | --------------------------------------------- | ----------------- |
| back_source_host | self_service_domain_configback_host | 回源 host 配置 |
| block_loop | self_service_domain_configblock_loop | 分片回源信息 |
| set_req_header | oms_customer_remark loop_http_header | 自定义回源 HTTP 请求头 |
| set_resp_header | httpHeaderConfigs | 自定义 HTTP 响应头 |
| backsource_redirection_status | isFollowed | 回源重定向跟随 |
| cache | cacheType | 缓存类型与过期时间信息 |
| custom_error_page | customPages | 自定义页面信息 |
| http2_status | omsCustomerRemark.http2 | 支持 HTTP/2 的协议配置 |
| video_drag_status | videoDrag | 拖拽播放信息 |
| gzip_staus | Encryption EncryptionGrade | 开启智能压缩功能 |
| brotli_status | omsCustomerRemarkPO.brotliSwitch | 开启 Brotli 压缩功能 |
| referrer_anti_stealing_link | refererAntiStealingLink | Referer 黑白名单 |
| ip_black_list | domainConfigBlackList | IP 黑名单; 指定 IP、IP 段来设置 |
| url_parameter | 新 | URL 参数缓存策略 |
| https_status | 新,但是要与 protocol 有关,只有 1、2 时才可以 | HTTPS 高级选项 |
| url_anti_stealing_link | 新 | URL 防盗链参数 |
| ua_anti_stealing_link | omsCustomerRemark.uaBlackAndWhite uaBlackList | UA 防盗链参数 |
| back_rewrite_uri | 新 | 回源 URL 改写 |
SelfServiceDomainAdvancedConfigDao
SelfServiceDomainAdvancedConfigPO
AdvancedConfigEnum
```sql
-- set_req_header
select http_header_config.* from http_header_config
inner join domain_config_http_header_config on http_header_config.id = domain_config_http_header_config.http_header_config_id
inner join self_service_domain_config ssdc on domain_config_http_header_config.domain_config_id = ssdc.id
where domain='www.zphtest202307102002.com';
# backsource_redirection_status
select is_followed from self_service_domain_config where domain='www.zphtest202307102002.com';
-- set_resp_header
select loop_http_header from oms_customer_remark left join self_service_domain_config ssdc on oms_customer_remark.id = ssdc.oms_customer_remark_id
where ssdc.domain='www.zphtest202307102002.com';
-- cache
select cache_type.* from cache_type
inner join domain_config_cache_type dcct on cache_type.id = dcct.cache_type_id
inner join self_service_domain_config ssdc on dcct.self_service_domain_config_id = ssdc.id
where domain='www.zphtest202307102002.com';
-- custom_error_page
select custom_page.* from custom_page
inner join domain_config_custom_page dccp on custom_page.id = dccp.custom_page_id
inner join self_service_domain_config ssdc on dccp.domain_config_id = ssdc.id
where domain='www.zphtest202307102002.com';
-- https2
select http2 from oms_customer_remark
join self_service_domain_config ssdc on oms_customer_remark.id = ssdc.oms_customer_remark_id
where domain='www.zphtest202307102002.com';
-- video_drag_status 拖拽播放信息
select video_drag
from self_service_domain_config
where domain = 'www.zphtest202307102002.com';
-- gzip_status 智能压缩
select encryption, encryption_grade from self_service_domain_config
inner join oms_customer_remark ocr on self_service_domain_config.oms_customer_remark_id = ocr.id
where domain='www.zphtest202307102002.com';
-- brotli_status 开启broli压缩功能
select brotli_switch from oms_customer_remark
inner join self_service_domain_config ssdc on oms_customer_remark.id = ssdc.oms_customer_remark_id
where domain='www.zphtest202307102002.com';
-- Referer黑白名单
select referer_anti_stealing_link.*, rbwl.* from referer_anti_stealing_link
inner join referer_anti_stealing_black_white_list on anti_stealing_link_id = referer_anti_stealing_link.id
inner join referer_black_white_list rbwl on referer_anti_stealing_black_white_list.black_white_id = rbwl.id
inner join self_service_domain_config ssdc on referer_anti_stealing_link.id = ssdc.referer_anti_stealing_link_id
where ssdc.domain='www.zphtest202307102002.com';
-- ip和白名单
select domain_ip_black_list.* from domain_ip_black_list
inner join domain_config_black_list dcbl on domain_ip_black_list.id = dcbl.black_id
inner join self_service_domain_config ssdc on dcbl.domain_config_id = ssdc.id
where domain='www.zphtest202307102002.com';
-- url_parameter\https_status\url_anti_stealing_link\ua_anti_stealing_link
select * from self_service_domain_advanced_config where domain='www.zphtest202307102002.com';
-- ua防盗链
select ua_black_list, ua_black_and_white, ua_null from oms_customer_remark
join self_service_domain_config ssdc on oms_customer_remark.id = ssdc.oms_customer_remark_id
where domain='www.zphtest202307102002.com';
```
### 新增/修改高级配置接口路径和参数
/api/config/action?commandType=manageDomainAdvancedConfig&version=1
```json
{
"domain": "www.zphtest202307102002.com",
// "referrer_anti_stealing_link": {
// "enable": true,
// "detail": {
// "list_type": 2,
// "referrer_null": true,
// "domain_list": [
// "*.10086.com",
// "www.10011186.co"
// ]
// }
// },
//分片回源信息
// "block_loop": true
//回源host
// "back_source_host": {
// "enable": false,
// "host": "www.baidu.com"
// }
//请求头设置
// "set_req_header": {
// "enable": true,
// "detail": [
// {
// "type": "Content-Language2",
// "value": "CN",
// "option": 1 //0 设置 1 删除
// },
// {
// "type": "Sec-Fetch-Mode",
// "value": "CN",
// "option": 0 //0 设置 1 删除
// }
// ]
// },
// 响应头
// "set_resp_header": {
// "enable": true,
// "detail": [
// {
// "type": "Sec-Fetch-Dest",
// "value": "text/xml",
// "option": 0 //0 设置 1 删除
// },
// {
// "type": "Sec-Fetch-Mode",
// "value": "text/xml",
// "option": 0 //0 设置 1 删除
// }
// ]
// },
//回源重定向跟随
// "backsource_redirection_status": "aaa",
//缓存类型与过期时间信息
// "cache": {
// "enable": true,
// "detail": [
// {
// "type": 0,
// "content": "/abc/def/",
// "ttl": 10,
// "unit": "day",
// "weight": 1,
// "followsource": 1
// },
// {
// "type": 0,
// "content": "jpg,txt",
// "ttl": 1,
// "unit": "hour",
// "weight": 1
// }
// ]
// },
// 自定义页面
// "custom_error_page": {
// "enable": false,
// "detail": [
// {
// "type": 1,
// // "mode": ,
// "link": "https://xxxx.xx/error.html"
// }
// ]
// },
//http2_status 支持http2协议
// "http2_status": true,
//video_drag_status 拖拽播放信息
// "video_drag_status": true
//gzip_status 要锁参数
// "gzip_status":false
// refer防盗链
// "referrer_anti_stealing_link": {
// "enable": true,
// "detail": {
// "list_type": 1,
// "referrer_null": true,
// "domain_list": [
// "*.10086.com",
// "www.10086.co"
// ]
// }
// }
//ip黑白名单
// "ip_black_list": {
// "enable": true,
// "ip_list": [
// "1:1::1:0/21",
// "1.1.1.0/24",
// "10.1.1.20-10.1.1.25"
// ]
// },
// url参数+缓存
// "url_parameter": {
// "enable": true,
// "shared_cache": {
// "enable": true,
// "target_domain": "video.baidu.com"
// },
// "detail": {
// "enable":true,
// "type": 2,
// "content": "param1;param2;param3;param4"
// }
// },
// https 高级配置
// "https_status": {
// "enable": true,
// "detail": {
// "https_force": true,
// "https_tls_version": [
// "tls1.0",
// "tls1.1",
// "tls1.2",
// "tls1.3"
// ]
// }
// }
// // url 防盗链
// "url_anti_stealing_link": {
// "enable": false,
// "detail": {
// "auth_type": 1,
// "auth_key": "abc1234",
// "auth_key_back": "xyz4321",
// "auth_param": "x-signature",
// "auth_encrypt": "HAMC_SHA1",
// "auth_timeout": 86400
// }
// },
// ua 防盗链
// "ua_anti_stealing_link": {
// "enable": true,
// "detail": {
// "list_type": 1,
// "ua_list": [
// "iphone",
// "android"
// ],
// "ua_null":true
// }
// },
// ua 防盗链
"back_rewrite_uri": {
"enable": true,
"detail": [
{
"rewrite_path": "",
"target_path": "abcdefghabcdefh"
},
{
"rewrite_path": "bb",
"target_path": "cc"
}
]
}
}
```
### 高级配置回调接口路径和参数
回调 url/action?commandType=manageDomainCallBack&version=1
```json
{
"domains": [
{
"domain": "www.zphtest202307102002.com",
"result": 0,
"cp_id": "83564834"
}
],
"callback_type": "create",
"task_id": "487bfb92a3414856b9a3e93003781d37",
"plain": [
1
]
}
```