网站管理:按 action 选择功能
这个请求地址通过 action 区分具体功能。下方列出每个 action 的参数、约束和调用示例。
https://your-panel.example.com:8888/siteRequest bodyX-WWW-FORM-URLENCODEDrequired
One of the following:
- AddDomain
- AddSite
- CloseHasPwd
- CloseSSLConf
- CloseToHttps
- CloseTomcat
- CreateProxy
- CreateRedirect
- DeleteRedirect
- DeleteSite
- Get301Status
- GetDefaultSite
- GetDirBinding
- GetDirUserINI
- GetDnsApi
- GetIndex
- GetLimitNet
- GetPHPVersion
- GetProxyList
- GetRedirectList
- GetRewriteList
- GetRewriteLists
- GetSSL
- GetSiteDomains
- GetSiteLogs
- GetSitePHPVersion
- GetSiteRunPath
- HttpToHttps
- ModifyProxy
- ModifyRedirect
- Set301Status
- SetEdate
- SetHasPwd
- SetLimitNet
- SetPHPVersion
- SetRewriteLists
- SetRewriteTel
- SetSSL
- SetSSLConf
- SiteStart
- SiteStop
- ToBackup
- apacheAddPort
- check_total_install_info
- create_default_conf
- create_flow_rule
- export_sites_to_csv
- get_404_config
- get_Scan
- get_cdn_ip_settings
- get_cron_scanin_info
- get_dir_auth
- get_domains
- get_free_total_status
- get_generated_flow_info
- get_https_mode
- get_https_settings
- get_restart_task
- get_security_headers
- get_site_errlog
- get_site_types
- get_sites_ftp
- get_sites_log_path
- get_ssl_protocol
- get_view_title_content
- list
- logsOpen
- multiple_basedir
- multiple_limit_net
- open_cdn_ip
- set_404_config
- set_create_default_conf
- set_cron_scanin_info
- set_dns_domains
- set_free_total_status
- set_global_http2https
- set_https_mode
- set_ignore_view_domain_title
- set_restart_task
- set_security_headers
- set_site_etime_multiple
- set_site_ignore_https_mode
- set_sites_ftp
- set_sites_log_path
- set_ssl_protocol
- site_rname
- test_domains_api
- webserverprep
Returns
default
响应因 action 而异,见下方各 action 的详细说明。
各操作详细说明
AddDomainaction=AddDomain为网站添加新域名绑定
为已有网站添加额外域名绑定。
- 路由:
POST /site - action:
AddDomain
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 AddDomain |
| id | 是 | Integer | 网站 ID |
| webname | 是 | String | 网站主域名 |
| domain | 是 | String | 要添加的新域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| domains | Array | 添加后的完整域名列表 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=AddDomain&id=1&webname=testapi.bt.local&domain=new.example.com
响应
{"domains": [{"name": "testapi.bt.local"}, {"name": "api-test.example.com"}, {"name": "new.example.com"}]}
AddSiteaction=AddSite创建新网站(PHP / 纯静态)
创建新网站,支持 PHP 和纯静态两种类型。自动生成 Nginx/Apache 配置、创建网站目录、可选同时创建 FTP 和数据库。
- 路由:
POST /site - action:
AddSite
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 AddSite |
| webname | 是 | String | JSON 字符串,格式 {"domain":"主域名","domainlist":[],"count":0} |
| path | 是 | String | 网站根目录路径,如 /www/wwwroot/域名 |
| type | 是 | String | 网站类型:PHP 或留空(纯静态) |
| version | 是 | String | PHP 版本号,如 85;纯静态传 00 |
| port | 是 | String | 监听端口,默认 80 |
| type_id | 否 | Integer | 分类 ID,默认 0 |
| ps | 否 | String | 备注 |
| ftp | 否 | String | 是否同时创建 FTP:"true" / "false" |
| sql | 否 | String | 是否同时创建数据库:"true" / "false" |
| codeing | 否 | String | 数据库字符集,默认 utf8 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| siteStatus | Boolean | 网站创建结果 |
| siteId | Integer | 新网站的 ID |
| ftpStatus | Boolean | FTP 用户创建结果(false 表示未创建) |
| databaseStatus | Boolean | 数据库创建结果(false 表示未创建) |
| gitStatus | Boolean | Git 部署状态 |
示例
创建 PHP 8.5 站点
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=AddSite&webname={"domain":"demo.bt.local","domainlist":[],"count":0}&path=/www/wwwroot/demo.bt.local&type=PHP&version=85&port=80&ps=测试站点
{"siteStatus": true, "siteId": 2, "ftpStatus": false, "databaseStatus": false, "gitStatus": false}
创建纯静态站点
action=AddSite&webname={"domain":"static.bt.local","domainlist":[],"count":0}&path=/www/wwwroot/static.bt.local&type=&version=00&port=80
纯静态不传
type=PHP,version=00。
{"siteStatus": true, "siteId": 3, "ftpStatus": false, "databaseStatus": false, "gitStatus": false}
相关接口
- DeleteSite — 删除网站
- GetPHPVersion — 获取可用 PHP 版本
CloseHasPwdaction=CloseHasPwd关闭网站的密码访问保护
关闭指定网站的密码访问保护(HTTP Basic Auth)。
- 路由:
POST /site - action:
CloseHasPwd
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 CloseHasPwd |
| id | 是 | Integer | 网站 ID |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=CloseHasPwd&id=1
响应
{"status": true, "msg": "设置成功"}
相关接口
CloseSSLConfaction=CloseSSLConf关闭网站的 SSL 证书
关闭指定网站的 SSL 证书,之后网站将仅通过 HTTP 访问。
- 路由:
POST /site - action:
CloseSSLConf
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 CloseSSLConf |
| siteName | 是 | String | 网站域名 |
| updateOf | 是 | String | 更新范围,固定 1 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示关闭成功 |
| msg | String | SSL已关闭! |
示例
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=CloseSSLConf&siteName=testapi.bt.local&updateOf=1
{"status": true, "msg": "SSL已关闭!"}
CloseToHttpsaction=CloseToHttps关闭 HTTP 到 HTTPS 的强制跳转
CloseToHttps / HttpToHttps
关闭或开启 HTTP 到 HTTPS 的强制跳转。
- 路由:
POST /site - action:
CloseToHttps或HttpToHttps
CloseToHttps
关闭 HTTP→HTTPS 强制跳转。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | CloseToHttps |
| siteName | 是 | String | 网站域名 |
HttpToHttps
开启 HTTP→HTTPS 强制跳转。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | HttpToHttps |
| siteName | 是 | String | 网站域名 |
注意:HttpToHttps 需要 SSL 证书已部署,否则返回
"当前未开启SSL"。
示例
关闭跳转
action=CloseToHttps&siteName=testapi.bt.local
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | 请求结果,true 表示成功 |
| msg | String | 提示信息 |
{"status": true, "msg": "设置成功"}
开启跳转(需 SSL)
action=HttpToHttps&siteName=testapi.bt.local
{"status": true, "msg": "设置成功"}
CloseTomcataction=CloseTomcat关闭网站的 Tomcat 反向代理配置
移除指定网站的 Tomcat 反向代理配置(Nginx/Apache 到 Tomcat 的转发)。
- 路由:
POST /site - action:
CloseTomcat
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 CloseTomcat |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Boolean | true 关闭成功,false Tomcat 未安装 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=CloseTomcat&siteName=testapi.bt.local
响应
false
CreateProxyaction=CreateProxy为网站创建反向代理规则
为指定网站创建反向代理,将指定路径的请求转发到后端服务。
- 路由:
POST /site - action:
CreateProxy
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 CreateProxy |
| sitename | 是 | String | 网站域名(注意小写) |
| proxyname | 是 | String | 代理名称(3~40 字节) |
| proxydir | 是 | String | 代理目录路径,如 /api 或 / |
| proxysite | 是 | String | 目标 URL,如 http://127.0.0.1:8080 |
| type | 是 | String | 类型:"1" 启用 |
| cache | 是 | String | "1" 启用缓存 / "0" 禁用 |
| cachetime | 是 | String | 缓存时间(分钟),禁用缓存时传 "0" |
| todomain | 是 | String | 目标域名($host 值),填网站域名即可 |
| subfilter | 是 | String | JSON 数组,内容替换规则 [{"sub1":"旧","sub2":"新"},...] |
| advanced | 是 | String | 高级模式:"1" / "0" |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 添加成功 |
| msg | String | 添加成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=CreateProxy&sitename=testapi.bt.local&proxyname=api_proxy&proxydir=/api&proxysite=http://127.0.0.1:9090&type=1&cache=0&cachetime=0&todomain=testapi.bt.local&subfilter=[{"sub1":"","sub2":""},{"sub1":"","sub2":""},{"sub1":"","sub2":""}]&advanced=0
响应
{"status": true, "msg": "添加成功"}
相关接口
- GetProxyList — 查询代理列表
- ModifyProxy — 修改代理
CreateRedirectaction=CreateRedirect为网站创建 301/302 重定向规则
为指定网站创建重定向规则,支持域名重定向和路径重定向。
- 路由:
POST /site - action:
CreateRedirect
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 CreateRedirect |
| sitename | 是 | String | 网站域名(注意小写) |
| redirectname | 是 | String | 重定向名称(唯一标识) |
| tourl | 是 | String | 目标 URL |
| redirectdomain | 是 | String | JSON 数组,来源域名列表 ["old.example.com"] |
| redirectpath | 是 | String | 来源路径,如 / 或 /old-path |
| redirecttype | 是 | String | 重定向类型:"path" / "domain" |
| type | 是 | String | "0" 启用 / "1" 301 永久 |
| domainorpath | 是 | String | "path" 路径重定向 / "domain" 域名重定向 |
| holdpath | 是 | String | "1" 保留路径 / "0" 不保留 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 创建成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=CreateRedirect&sitename=testapi.bt.local&redirectname=old_site&tourl=http://example.com&redirectdomain=["old.example.com"]&redirectpath=/&redirecttype=path&type=0&domainorpath=path&holdpath=0
响应
{"status": true, "msg": "创建成功"}
相关接口
- GetRedirectList — 查询重定向列表
- ModifyRedirect — 修改重定向
- DeleteRedirect — 删除重定向
DeleteRedirectaction=DeleteRedirect删除网站的重定向规则
删除指定网站的某条重定向规则。
- 路由:
POST /site - action:
DeleteRedirect
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 DeleteRedirect |
| sitename | 是 | String | 网站域名(注意小写) |
| redirectname | 是 | String | 要删除的重定向名称 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 删除成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=DeleteRedirect&sitename=testapi.bt.local&redirectname=old_site
响应
{"status": true, "msg": "删除成功"}
相关接口
- CreateRedirect — 创建重定向
- GetRedirectList — 查询重定向列表
DeleteSiteaction=DeleteSite删除网站及关联配置
删除指定网站,包括其 Nginx/Apache 配置、SSL 证书、日志等关联文件。
- 路由:
POST /site - action:
DeleteSite
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 DeleteSite |
| id | 是 | Integer | 网站 ID |
| webname | 是 | String | 网站域名 |
网站 ID 通过
/data接口查询sites表获得。
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 删除成功 |
| msg | String | 站点删除成功! |
示例
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=DeleteSite&id=2&webname=demo.bt.local
{"status": true, "msg": "站点删除成功!"}
相关接口
- AddSite — 创建网站
Get301Statusaction=Get301Status获取网站 301 重定向配置
获取当前 301 重定向配置。
- 路由:
POST /site - action:
Get301Status
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 Get301Status |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| domain | String | 重定向域名 |
| src | String | 来源 |
| status | Boolean | 是否启用 |
| url | String | 目标 URL |
示例
{"domain": "", "src": "", "status": true, "url": "http://testapi.bt.local$request_uri"}
相关接口
- Set301Status — 设置 301 重定向
GetDefaultSiteaction=GetDefaultSite获取默认站点配置
获取面板默认站点配置,包括当前是否有默认站点、站点列表。
- 路由:
POST /site - action:
GetDefaultSite
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetDefaultSite |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| sites | Array | 可用站点列表 |
| defaultSite | Boolean/String | 默认站点名,false 表示未设置 |
示例
{"sites": [{"name": "testapi.bt.local"}], "defaultSite": false}
GetDirBindingaction=GetDirBinding获取网站子目录绑定列表
获取指定网站的子目录(二级域名)绑定列表。
- 路由:
POST /site - action:
GetDirBinding
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetDirBinding |
| id | 是 | Integer | 网站 ID |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| run_path | String | 运行目录路径 |
| dirs | Array | 可选子目录列表 |
| binding | Array | 已绑定的子目录列表 |
示例
{"run_path": "/", "dirs": [], "binding": []}
GetDirUserINIaction=GetDirUserINI获取网站目录保护配置(防跨站、日志、Git 同步状态)
获取指定网站的目录保护和安全配置状态,包括防跨站攻击、日志开关、Git 同步及密码访问状态。
- 路由:
POST /site - action:
GetDirUserINI
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetDirUserINI |
| id | 是 | Integer | 网站 ID |
| path | 是 | String | 网站根目录路径,如 /www/wwwroot/testapi.bt.local |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| sync_git | Boolean | 是否开启 Git 同步 |
| logs | Boolean | 是否开启日志 |
| userini | Boolean | 是否启用防跨站保护 |
| runPath | Object | 运行目录信息 {runPath, dirs} |
| pass | Boolean | 是否启用密码访问保护 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=GetDirUserINI&id=1&path=/www/wwwroot/testapi.bt.local
响应
{
"sync_git": false,
"logs": true,
"userini": true,
"runPath": {"runPath": "/", "dirs": ["/"]},
"pass": false
}
GetDnsApiaction=GetDnsApi获取支持的 DNS API 提供商列表(CloudFlare、阿里云、DNSPod 等)
获取面板支持的 DNS API 提供商列表,用于 SSL 证书的 DNS-01 域名验证。
- 路由:
POST /site - action:
GetDnsApi
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetDnsApi |
输出参数
返回数组,每项:
| 参数名称 | 类型 | 描述 |
|---|---|---|
| name | String | DNS 提供商标识 |
| title | String | 显示名称,如 阿里云DNS、DnsPod、CloudFlare |
| ps | String | 描述说明 |
| data | Array | 需要的配置字段 [{key, value, name}] |
| help | String | 获取帮助链接 |
| key | String | API Key 存储键名 |
示例
响应
[
{"name": "dns", "title": "手动解析", "ps": "返回host和txt值,由用户手动解析", "data": false},
{"name": "AliyunDns", "title": "阿里云DNS", "data": [{"key": "SAVED_Ali_Key", "name": "AccessKey"}, {"key": "SAVED_Ali_Secret", "name": "SecretKey"}]},
{"name": "DNSPodDns", "title": "DnsPod", "data": [{"key": "SAVED_DP_Id", "name": "ID"}, {"key": "SAVED_DP_Key", "name": "Token"}]},
{"name": "CloudFlareDns", "title": "CloudFlare", "data": [{"key": "SAVED_CF_MAIL", "name": "E-Mail"}, {"key": "SAVED_CF_KEY", "name": "API Key"}]}
]
GetHasPwd查看网站密码访问保护状态
GetHasPwd / CloseHasPwd
查看或关闭网站的密码访问保护(HTTP Basic Auth)。
- 路由:
POST /site
GetHasPwd
查看密码保护状态。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | GetHasPwd |
| id | 是 | Integer | 网站 ID |
输出
| 参数名称 | 类型 | 描述 |
|---|---|---|
| (原始值) | Boolean | true = 已启用密码保护,false = 未启用 |
false
CloseHasPwd
关闭密码保护。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | CloseHasPwd |
| id | 是 | Integer | 网站 ID |
输出
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
| msg | String | 提示信息 |
{"status": true, "msg": "设置成功"}
相关接口
- SetHasPwd — 设置密码保护
GetIndexaction=GetIndex获取网站的默认文档设置
获取指定网站的默认文档(首页文件)列表。
- 路由:
POST /site - action:
GetIndex - 返回类型:String(非 JSON)
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetIndex |
| id | 是 | Integer | 网站 ID |
网站 ID 可通过
/data接口查询sites表获得:action=getData&table=sites&type=-1
输出参数
返回逗号分隔的字符串,按优先级排列默认文档文件名。
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=GetIndex&id=1
响应
index.php,index.html,index.htm,default.php,default.htm,default.html
GetLimitNetaction=GetLimitNet获取网站的流量限制配置(并发、IP、速率)
获取指定网站的流量限制和并发连接配置。
- 路由:
POST /site - action:
GetLimitNet
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetLimitNet |
| id | 是 | Integer | 网站 ID |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| perserver | Integer | 单服务器最大并发连接数 |
| perip | Integer | 单 IP 最大并发连接数 |
| limit_rate | Integer | 单连接速率限制(KB/s) |
| value | Integer | 状态值 |
示例
响应
{"perserver": 100, "perip": 10, "limit_rate": 512, "value": 0}
GetPHPVersionaction=GetPHPVersion获取面板已安装的 PHP 版本列表
获取面板上已安装的所有 PHP 版本及运行状态。
- 路由:
POST /site - action:
GetPHPVersion
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetPHPVersion |
输出参数
返回数组,每项:
| 参数名称 | 类型 | 描述 |
|---|---|---|
| version | String | 版本号,00 表示纯静态 |
| name | String | 显示名称,如 PHP-85、纯静态 |
| status | Boolean | 是否正在运行 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=GetPHPVersion
响应
[
{"version": "00", "name": "纯静态", "status": true},
{"version": "85", "name": "PHP-85", "status": true}
]
GetProxyListaction=GetProxyList获取网站的反向代理列表
获取指定网站已配置的所有反向代理规则。
- 路由:
POST /site - action:
GetProxyList
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetProxyList |
| sitename | 是 | String | 网站域名(注意小写) |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Array<Object> | 代理规则列表,每项含 proxyname、proxydir、proxysite、todomain、type、cache、cachetime 等 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=GetProxyList&sitename=testapi.bt.local
响应
[{"proxyname": "api_proxy", "proxydir": "/api", "proxysite": "http://127.0.0.1:9090", "todomain": "testapi.bt.local", "type": 1, "cache": 0}]
GetRedirectListaction=GetRedirectList获取网站的重定向规则列表
获取指定网站已配置的所有重定向规则。
- 路由:
POST /site - action:
GetRedirectList
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetRedirectList |
| sitename | 是 | String | 网站域名(注意小写) |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Array<Object> | 重定向规则列表,每项含 redirectname、tourl、redirectdomain、redirectpath、type 等 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=GetRedirectList&sitename=testapi.bt.local
响应
[{"sitename": "testapi.bt.local", "redirectname": "old_site", "tourl": "http://example.com", "redirectdomain": ["old.example.com"], "redirectpath": "/", "type": 0}]
GetRewriteListaction=GetRewriteList获取伪静态规则模板列表
获取可用的伪静态(URL 重写)规则模板列表,用于 Nginx/Apache 的 URL 美化。
- 路由:
POST /site - action:
GetRewriteList
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetRewriteList |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| rewrite | Array | 可用模板名列表(0.当前 表示当前使用的规则) |
| default_list | Array | Web 服务器默认支持的模板名列表 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=GetRewriteList&siteName=testapi.bt.local
响应
{
"rewrite": ["0.当前", "EduSoho", "EmpireCMS", "dedecms", "discuz", "drupal", "ecshop", "laravel5", "wordpress", "default"],
"default_list": ["default"]
}
GetRewriteListsaction=GetRewriteLists获取所有可用的伪静态规则模板文件列表
获取所有可用的伪静态规则模板文件列表,按站点和模板分类。
- 路由:
POST /site - action:
GetRewriteLists
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetRewriteLists |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| err_site | Array | 配置异常的站点列表 |
| site_rewrites | Array | 各站点当前使用的规则 |
| template_rewrites | Array | 可用模板列表 |
示例
{
"err_site": [],
"site_rewrites": [],
"template_rewrites": [
{"name": "wordpress", "file": "/www/server/panel/rewrite/nginx/wordpress.conf"},
{"name": "laravel5", "file": "/www/server/panel/rewrite/nginx/laravel5.conf"}
]
}
GetSSLaction=GetSSL获取网站的 SSL 证书信息(证书状态、域名、TLS 版本配置)
获取指定网站的 SSL 证书完整信息,包括证书部署状态、域名列表、TLS 协议版本配置。
- 路由:
POST /site - action:
GetSSL
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetSSL |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | SSL 是否已部署 |
| oid | Integer | 证书订单 ID,-1 = 无 |
| domain | Array | 网站域名列表 [{name, apply_ssl, dns_status}] |
| key | Boolean | 是否有私钥文件 |
| csr | Boolean | 是否有证书文件 |
| type | Integer | 证书类型,-1 = 无 |
| httpTohttps | Boolean | 是否开启 HTTP 强制跳转 HTTPS |
| cert_data | Object | 证书信息(颁发者、到期时间等) |
| tls_versions | Object | TLS 协议版本开关 {TLSv1, TLSv1.1, TLSv1.2, TLSv1.3} |
| auth_type | String | 认证方式(http / dns) |
| String | 申请邮箱 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=GetSSL&siteName=testapi.bt.local
响应(未部署 SSL)
{
"status": false,
"oid": -1,
"domain": [{"name": "testapi.bt.local"}, {"name": "api-test.example.com"}],
"key": false,
"csr": false,
"type": -1,
"httpTohttps": false,
"cert_data": {},
"tls_versions": {"TLSv1": false, "TLSv1.1": true, "TLSv1.2": true, "TLSv1.3": true},
"auth_type": "http",
"email": "test@message.com"
}
GetSiteDomainsaction=GetSiteDomains获取网站所有绑定域名详情
获取指定网站绑定的所有域名详情,包含 SSL 申请状态、DNS 状态等信息。
- 路由:
POST /site - action:
GetSiteDomains
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetSiteDomains |
| id | 是 | Integer | 网站 ID |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| domains | Array | 域名列表 |
| domains[].name | String | 域名 |
| domains[].binding | Boolean | 是否为子目录绑定 |
| domains[].apply_ssl | Integer | SSL 申请状态 |
| domains[].dns_status | Integer | DNS 状态 |
示例
{
"domains": [
{"name": "testapi.bt.local", "binding": false, "apply_ssl": 1, "dns_status": 0},
{"name": "api-test.example.com", "binding": false, "apply_ssl": 1, "dns_status": 0}
]
}
GetSiteLogsaction=GetSiteLogs获取网站的访问日志内容
获取指定网站的 Web 访问日志内容。
- 路由:
POST /site - action:
GetSiteLogs
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetSiteLogs |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 读取成功 |
| msg | String | 日志内容(可能为空字符串) |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=GetSiteLogs&siteName=testapi.bt.local
响应
{"status": true, "msg": ""}
msg为空表示暂无访问日志。
GetSitePHPVersionaction=GetSitePHPVersion获取指定网站使用的 PHP 版本
获取指定网站当前使用的 PHP 版本及其他运行环境信息。
- 路由:
POST /site - action:
GetSitePHPVersion
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetSitePHPVersion |
| siteName | 是 | String | 网站域名,如 testapi.bt.local |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| phpversion | String | PHP 版本号,如 85、00(纯静态) |
| tomcat | Integer | Tomcat 状态,-1 表示未启用 |
| tomcatversion | Boolean/String | Tomcat 版本 |
| nodejsversion | Boolean/String | Node.js 版本 |
| php_other | String | 其他 PHP 配置 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=GetSitePHPVersion&siteName=testapi.bt.local
响应
{
"phpversion": "85",
"tomcat": -1,
"tomcatversion": false,
"nodejsversion": false,
"php_other": ""
}
GetSiteRunPathaction=GetSiteRunPath获取网站运行目录配置
获取网站的 PHP 运行目录配置。
- 路由:
POST /site - action:
GetSiteRunPath
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetSiteRunPath |
| id | 是 | Integer | 网站 ID |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| runPath | String | 运行目录路径,/ 表示根目录 |
| dirs | Array | 可选子目录列表 |
示例
响应
{"runPath": "/", "dirs": ["/"]}
HttpToHttpsaction=HttpToHttps开启网站的 HTTP 自动跳转 HTTPS
为已部署 SSL 证书的网站开启 HTTP → HTTPS 自动跳转。
前置条件:网站已部署有效的 SSL 证书。
- 路由:
POST /site - action:
HttpToHttps
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 HttpToHttps |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=HttpToHttps&siteName=testapi.bt.local
响应
{"status": true, "msg": "设置成功"}
ModifyProxyaction=ModifyProxy修改已有的反向代理规则
修改指定网站已有反向代理的目标 URL、缓存等配置。需先用 CreateProxy 创建代理。
- 路由:
POST /site - action:
ModifyProxy
输入参数
同 CreateProxy,额外要求 proxyname 匹配已有代理名称。
type 含义有所不同:
"1"— 修改代理配置(目标 URL、目录、缓存等)"0"— 切换代理类型/关闭
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 修改成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=ModifyProxy&sitename=testapi.bt.local&proxyname=api_proxy&proxydir=/api&proxysite=http://127.0.0.1:9099&type=1&cache=0&cachetime=0&todomain=testapi.bt.local&subfilter=[{"sub1":"","sub2":""},{"sub1":"","sub2":""},{"sub1":"","sub2":""}]&advanced=0
响应
{"status": true, "msg": "修改成功"}
相关接口
- CreateProxy — 创建代理
- GetProxyList — 查询代理列表
ModifyRedirectaction=ModifyRedirect修改已有的重定向规则
修改指定网站已有重定向规则的目标 URL、域名等配置。
参数与 CreateRedirect 相同,以 sitename + redirectname 定位要修改的规则。
- 路由:
POST /site - action:
ModifyRedirect
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 修改成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=ModifyRedirect&sitename=testapi.bt.local&redirectname=old_site&tourl=http://newtarget.com&redirectdomain=["old.example.com"]&redirectpath=/&redirecttype=path&type=0&domainorpath=path&holdpath=0
响应
{"status": true, "msg": "修改成功"}
Set301Statusaction=Set301Status设置网站 301 永久重定向规则
为网站设置 301 永久重定向规则,将指定来源域名跳转到目标 URL。
- 路由:
POST /site - action:
Set301Status
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 Set301Status |
| siteName | 是 | String | 网站域名 |
| srcDomain | 是 | String | 来源域名,必须带 http:// 前缀 |
| toDomain | 是 | String | 目标 URL,必须带 http:// 前缀 |
| type | 是 | String | 重定向类型,1 = 域名重定向 |
相关接口
- Get301Status — 获取当前重定向配置
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示操作成功 |
| msg | String | 提示信息 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=Set301Status&siteName=testapi.bt.local&srcDomain=http://old.test.com&toDomain=http://testapi.bt.local&type=1
响应
{"status": true, "msg": "操作成功"}
SetEdateaction=SetEdate设置网站到期时间
设置网站的到期时间。到期后网站将自动停止。
- 路由:
POST /site - action:
SetEdate
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetEdate |
| id | 是 | Integer | 网站 ID |
| edate | 是 | String | 到期日期,0000-00-00 表示永久有效 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示设置成功 |
| msg | String | 提示信息 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=SetEdate&id=1&edate=0000-00-00
响应
{"status": true, "msg": "设置成功,站点到期后将自动停止!"}
SetHasPwdaction=SetHasPwd设置网站密码访问保护
为网站设置基于 HTTP Basic Auth 的密码访问保护。
- 路由:
POST /site - action:
SetHasPwd
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetHasPwd |
| id | 是 | Integer | 网站 ID |
| username | 是 | String | 访问用户名 |
| password | 是 | String | 密码(不超过 8 位) |
密码限制 8 位,超过部分无法验证。
相关接口
- GetHasPwd — 查看密码保护状态
- CloseHasPwd — 关闭密码保护
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示设置成功 |
| msg | String | 提示信息 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=SetHasPwd&id=1&username=admin&password=Test2024
响应
{"status": true, "msg": "设置成功"}
SetLimitNetaction=SetLimitNet设置网站流量限制和并发连接限制
设置网站的流量限制、并发连接限制和单连接速率限制。
- 路由:
POST /site - action:
SetLimitNet
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetLimitNet |
| id | 是 | Integer | 网站 ID |
| perserver | 是 | Integer | 单服务器最大并发连接数 |
| perip | 是 | Integer | 单 IP 最大并发连接数 |
| limit_rate | 是 | Integer | 单连接速率限制(KB/s) |
三个参数均必须大于 0。
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示设置成功 |
| msg | String | 提示信息 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=SetLimitNet&id=1&perserver=100&perip=10&limit_rate=512
响应
{"status": true, "msg": "设置成功"}
SetPHPVersionaction=SetPHPVersion切换网站的 PHP 版本
切换指定网站的 PHP 版本。
- 路由:
POST /site - action:
SetPHPVersion
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetPHPVersion |
| siteName | 是 | String | 网站域名 |
| version | 是 | String | PHP 版本号,"00" 纯静态,"74"/"80"/"81"/"82"/"83"/"84" 等 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 切换成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=SetPHPVersion&siteName=testapi.bt.local&version=00
响应
{"status": true, "msg": "成功切换网站[testapi.bt.local]的PHP版本为PHP-00"}
SetRewriteListsaction=SetRewriteLists批量为多个网站设置伪静态规则
批量为多个网站设置伪静态模板文件。
- 路由:
POST /site - action:
SetRewriteLists
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetRewriteLists |
| sites | 是 | String | JSON 数组,网站列表 [{"name":"site1"},...] |
| rewrite_data | 是 | String | 伪静态模板名称 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Array | 设置结果列表,空数组表示无操作 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=SetRewriteLists&sites=[]&rewrite_data=
响应
[]
SetRewriteTelaction=SetRewriteTel保存自定义 URL 重写规则到模板文件
将自定义 URL 重写(伪静态)规则保存为模板文件。
- 路由:
POST /site - action:
SetRewriteTel
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetRewriteTel |
| name | 是 | String | 模板名称(不含路径和扩展名) |
| data | 是 | String | 重写规则内容 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 保存成功 |
| msg | String | 已保存URL重写规则到模板! |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=SetRewriteTel&name=testapi.bt.local&data=rewrite ^/old$ /new permanent;
响应
{"status": true, "msg": "已保存URL重写规则到模板!"}
SetSSLaction=SetSSL为网站部署自定义 SSL 证书
为指定网站部署自定义 SSL 证书(PEM 格式)。面板会验证证书和私钥的匹配性、证书链完整性,验证通过后写入配置并重载 Web 服务器。
- 路由:
POST /site - action:
SetSSL
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetSSL |
| siteName | 是 | String | 网站域名 |
| key | 是 | String | 证书私钥(PEM 格式,含 -----BEGIN PRIVATE KEY-----) |
| csr | 是 | String | 证书文件(PEM 格式,含 -----BEGIN CERTIFICATE-----) |
验证规则
key必须包含KEYcsr必须包含CERTIFICATE- 证书必须是有效的 PEM 格式
- 私钥和证书必须互相对应匹配
- 证书链必须完整
验证失败时返回具体错误提示。
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示部署成功 |
| msg | String | 证书已保存! |
示例
生成自签名证书
openssl genrsa -out key.pem 2048
openssl req -new -x509 -key key.pem -out cert.pem -days 365 \
-subj "/C=CN/ST=GD/L=SZ/O=Test/CN=testapi.bt.local"
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=SetSSL&siteName=testapi.bt.local&key=-----BEGIN PRIVATE KEY-----...&csr=-----BEGIN CERTIFICATE-----...
key和csr中换行符\n需保留。
响应
{"status": true, "msg": "证书已保存!"}
相关接口
- GetSSL — 查看证书信息
- CloseSSLConf — 关闭 SSL
- HttpToHttps — HTTP→HTTPS 跳转
SetSSLConfaction=SetSSLConf为网站开启 SSL 并批量部署证书(兼容多项目类型)
为指定网站开启 SSL(HTTPS),兼容 Nginx/Apache 以及 PHP/Node/Java/Go 等多种项目类型。
- 路由:
POST /site - action:
SetSSLConf
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SetSSLConf |
| siteName | 是 | String | 网站域名 |
| first_domain | 否 | String | 主域名(批量部署时传) |
| isBatch | 否 | String | 批量部署标记 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 开启成功 |
| msg | String | SSL开启成功! |
| csr | String | PEM 格式证书内容 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=SetSSLConf&siteName=testapi.bt.local
响应
{"status": true, "msg": "SSL开启成功!", "csr": "-----BEGIN CERTIFICATE-----\n..."}
SiteStartaction=SiteStart启动(启用)指定网站
启动(启用)已停止的网站。
- 路由:
POST /site - action:
SiteStart
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 SiteStart |
| id | 是 | Integer | 网站 ID |
| name | 是 | String | 网站域名 |
id和name必须同时传入。
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 启用成功 |
| msg | String | 站点已启用 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=SiteStart&id=1&name=testapi.bt.local
响应
{"status": true, "msg": "站点已启用"}
相关接口
- SiteStop — 停用网站
SiteStopaction=SiteStop停止网站(将网站设为停用状态)
SiteStop / SiteStart
停止或启动指定的网站。
- 路由:
POST /site - action:
SiteStop或SiteStart
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | SiteStop 或 SiteStart |
| id | 是 | Integer | 网站 ID |
| name | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 表示操作成功 |
| msg | String | 站点已停用 或 站点已启用 |
示例
停止网站
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=SiteStop&id=1&name=testapi.bt.local
{"status": true, "msg": "站点已停用"}
启动网站
action=SiteStart&id=1&name=testapi.bt.local
{"status": true, "msg": "站点已启用"}
ToBackupaction=ToBackup备份网站文件
备份指定网站的所有文件。
- 路由:
POST /site - action:
ToBackup
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 ToBackup |
| id | 是 | Integer | 网站 ID |
示例
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=ToBackup&id=1
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | 请求结果,true 表示成功 |
| msg | String | 提示信息 |
{"status": true, "msg": "备份成功!"}
apacheAddPortaction=apacheAddPort为 Apache 添加额外的 HTTPS 监听端口
为 Apache Web 服务器添加额外的 SSL 监听端口。仅在 Apache 环境下有效,Nginx 环境返回 null。
- 路由:
POST /site - action:
apacheAddPort
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 apacheAddPort |
| port | 是 | Integer | 要添加的 HTTPS 端口号 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Boolean | true 添加成功,Nginx 环境返回 null |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=apacheAddPort&port=8443
响应
null
check_total_install_infoaction=check_total_install_info检查网站监控报表插件的安装和版本状态
检查「网站监控报表」插件是否已安装、版本是否满足要求以及是否有购买授权。
- 路由:
POST /site - action:
check_total_install_info
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 check_total_install_info |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| total_status | Boolean | 插件版本是否满足要求(≥7.6) |
| nginx_status | Boolean | Nginx 状态 |
| buy_status | Boolean | 是否已购买授权 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=check_total_install_info
响应
{"total_status": false, "nginx_status": true, "buy_status": false}
create_default_confaction=create_default_conf获取创建网站时的默认配置项(404页面、默认首页、日志切割等)
获取新建网站时的全局默认配置状态,包括 404 页面、默认首页、日志切割、CDN IP 获取等开关。
- 路由:
POST /site - action:
create_default_conf
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 create_default_conf |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| page_404 | Boolean | 是否自动创建 404 页面 |
| page_index | Boolean | 是否自动创建默认首页 |
| log_split | Boolean | 是否开启日志切割 |
| cdn_ip | Boolean | 是否获取 CDN IP |
| cdn_recursive | Boolean | CDN 递归获取 |
| log_path | String | 日志存储路径 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=create_default_conf
响应
{"page_404": true, "page_index": true, "log_split": false, "cdn_ip": false, "cdn_recursive": false, "log_path": "/www/wwwlogs"}
create_flow_ruleaction=create_flow_rule创建网站流量规则
创建网站流量统计规则。
- 路由:
POST /site - action:
create_flow_rule
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 create_flow_rule |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | 请求结果,true 表示成功 |
| msg | String | 提示信息 |
{"status": true, "msg": "创建成功"}
相关接口
- get_generated_flow_info — 查看流量统计
export_sites_to_csvaction=export_sites_to_csv将网站列表导出为 CSV 文件
将指定网站的信息导出为 CSV 文件。
- 路由:
POST /site - action:
export_sites_to_csv
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 export_sites_to_csv |
| sites_id | 是 | String | 网站 ID,多个用逗号分隔 |
| csv_file_name | 是 | String | 导出的 CSV 文件名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 导出成功 |
| msg | String | 数据已成功导出到 xxx.csv |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=export_sites_to_csv&sites_id=1&csv_file_name=test.csv
响应
{"status": true, "msg": "数据已成功导出到 test.csv"}
get_404_configaction=get_404_config获取网站自定义 404 页面配置
get_404_config / set_404_config
获取或设置网站的自定义 404 页面状态。
- 路由:
POST /site - action:
get_404_config或set_404_config
get_404_config
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | get_404_config |
| siteName | 是 | String | 网站域名 |
响应
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | String | "1" = 已开启,"0" = 已关闭 |
{"status": "1"}
set_404_config
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | set_404_config |
| siteName | 是 | String | 网站域名 |
| status | 是 | String | "1" 开启,"0" 关闭 |
响应
{"status": true, "msg": "修改成功!"}
get_Scanaction=get_Scan获取网站漏洞扫描结果缓存
获取最近一次网站漏洞扫描的缓存结果。
- 路由:
POST /site - action:
get_Scan
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_Scan |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| info | Array | 扫描结果(可能为空) |
| time | Integer | 扫描时间戳 |
| loophole_num | Integer | 漏洞数量 |
| site_num | Integer | 已扫描网站数 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_Scan
响应
{"info": [], "time": 1779504854, "loophole_num": 0, "site_num": 1}
get_cdn_ip_settingsaction=get_cdn_ip_settings获取 CDN IP 获取的全局配置
获取面板全局的 CDN 客户端真实 IP 获取配置。
- 路由:
POST /site - action:
get_cdn_ip_settings
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_cdn_ip_settings |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| cdn_ip | Boolean | CDN IP 获取是否开启 |
| cdn_recursive | Boolean | 是否递归获取 |
| header_cdn | String | CDN 头字段名 |
| white_ips | String | CDN IP 白名单 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_cdn_ip_settings
响应
{"cdn_ip": false, "cdn_recursive": false, "header_cdn": "X-Forwarded-For", "white_ips": "0.0.0.0/0,::/0"}
get_cron_scanin_infoaction=get_cron_scanin_info获取网站漏洞扫描定时任务的配置
获取漏洞扫描定时任务的当前配置,包括扫描周期、推送渠道和开关状态。
- 路由:
POST /site - action:
get_cron_scanin_info
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_cron_scanin_info |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| cycle | Integer | 扫描周期(天) |
| channel | String | 消息推送渠道 |
| status | Integer | 1 开启,0 关闭 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_cron_scanin_info
响应
{"cycle": 1, "channel": "", "status": 0}
get_dir_authaction=get_dir_auth获取网站的目录密码保护配置列表
获取指定网站的目录密码保护(HTTP Basic Auth)配置列表。
- 路由:
POST /site - action:
get_dir_auth
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_dir_auth |
| id | 否 | Integer | 网站 ID |
| siteName | 否 | String | 网站域名(与 id 二选一) |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Object | 以域名为 key 的目录保护配置对象 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_dir_auth&id=1
响应
{"testapi.bt.local": []}
空数组表示该站点暂无目录保护配置。
get_domainsaction=get_domains获取网站绑定的域名列表
获取指定网站绑定的域名列表。
- 路由:
POST /site - action:
get_domains
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | get_domains |
| siteName | 是 | String | 网站域名 |
输出
返回字符串数组,每项为域名字符串。空数组表示无额外绑定。
[]
get_free_total_statusaction=get_free_total_status获取网站的免费流量限制状态
查询指定网站或全局的免费流量限制开关状态。
- 路由:
POST /site - action:
get_free_total_status
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_free_total_status |
| site_id | 是 | String | 网站 ID,传 "global" 查询全局 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 查询成功 |
| data | Object | {"status": true/false} |
| msg | String | 结果消息 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_free_total_status&site_id=1
响应
{"status": true, "data": {"status": true}, "msg": "获取成功"}
相关接口
- set_free_total_status — 设置状态
get_generated_flow_infoaction=get_generated_flow_info获取网站流量统计摘要信息
获取网站的流量统计摘要,包括请求数和流量总量。
需要安装「网站监控报表」插件。
- 路由:
POST /site - action:
get_generated_flow_info
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_generated_flow_info |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| length | Integer | 总流量(字节) |
| request | Integer | 总请求数 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_generated_flow_info
响应
{"length": 0, "request": 0}
get_https_modeaction=get_https_mode获取面板 HTTPS 全局模式(宽松/严格)
获取面板 HTTPS 全局模式。false 为宽松模式(未部署 SSL 时仍可 HTTP 访问),true 为严格模式。
- 路由:
POST /site - action:
get_https_mode
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_https_mode |
无其他参数。
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Boolean | true 严格模式,false 宽松模式 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_https_mode
响应
false
get_https_settingsaction=get_https_settings获取网站 HTTPS 配置状态
获取网站的 HTTPS 模式及 HTTP→HTTPS 跳转状态。
- 路由:
POST /site - action:
get_https_settings
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_https_settings |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | 请求结果 |
| data.https_mode | Boolean | 是否开启 HTTPS |
| data.http2https | Boolean | 是否开启 HTTP→HTTPS 强制跳转 |
| code | Integer | 状态码 |
| timestamp | Integer | 时间戳 |
示例
请求
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=get_https_settings
响应
{
"status": true,
"msg": "ok",
"data": {"https_mode": false, "http2https": false},
"code": 0,
"timestamp": 1779443313
}
get_restart_taskaction=get_restart_task获取网站自动重启守护任务的配置状态
查询 Apache/Nginx 守护进程(自动重启)任务的配置状态。
- 路由:
POST /site - action:
get_restart_task
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_restart_task |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 成功 |
| msg | Object | 包含 status 字段,0 关闭 / 1 开启 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_restart_task
响应
{"status": true, "msg": {"status": 0}}
get_security_headersaction=get_security_headers获取网站的 HTTP 安全响应头配置
获取指定网站的 HTTP 安全响应头配置状态。
- 路由:
POST /site - action:
get_security_headers
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_security_headers |
| site_name | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| x_xss_protection | Boolean | XSS 保护开关 |
| x_content_type_options | Boolean | Content-Type 选项 |
| referrer_policy | Boolean | Referrer 策略 |
| content_security_policy | Boolean | CSP 策略 |
| permissions_policy | Boolean | 权限策略 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_security_headers&site_name=testapi.bt.local
响应
{"x_xss_protection": false, "x_content_type_options": false, "referrer_policy": false, "content_security_policy": false, "permissions_policy": false}
get_site_errlogaction=get_site_errlog获取网站的 Nginx/Apache 错误日志内容
获取指定网站的错误日志,自动根据 Web 服务器类型和项目类型定位日志文件。
- 路由:
POST /site - action:
get_site_errlog
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_site_errlog |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 成功 |
| msg | String | 错误日志内容(可能为空) |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_site_errlog&siteName=testapi.bt.local
响应
{"status": true, "msg": ""}
get_site_typesaction=get_site_types获取网站分类列表
获取面板中网站的分类列表。
- 路由:
POST /site - action:
get_site_types
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_site_types |
输出参数
返回数组,每项:
| 参数名称 | 类型 | 描述 |
|---|---|---|
| id | Integer | 分类 ID,0 = 默认分类,-2 = 已停止网站 |
| name | String | 分类名称 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
request_time=1700000000&request_token=xxx&action=get_site_types
响应
[
{"id": 0, "name": "默认分类"},
{"id": -2, "name": "已停止网站"}
]
get_sites_ftpaction=get_sites_ftp获取网站关联的 FTP 账户信息
查询指定网站是否关联了 FTP 账户及其信息。
- 路由:
POST /site - action:
get_sites_ftp
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_sites_ftp |
| siteName | 否 | String | 网站域名 |
| site_id | 否 | Integer | 网站 ID(与 siteName 二选一) |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 查询成功 |
| msg | String | 结果消息 |
| info | Object | FTP 账户信息,无关联时 null |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_sites_ftp&siteName=testapi.bt.local
响应
{"status": true, "msg": "没有对应站点的ftp信息", "info": null}
get_sites_log_pathaction=get_sites_log_path获取网站的日志文件存储路径
获取指定网站的 Web 日志存储路径。
- 路由:
POST /site - action:
get_sites_log_path
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_sites_log_path |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | String | 日志目录路径,如 /www/wwwlogs |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_sites_log_path&siteName=testapi.bt.local
响应
/www/wwwlogs
get_ssl_protocolaction=get_ssl_protocol获取网站 TLS 协议版本配置
get_ssl_protocol / set_ssl_protocol
获取或设置网站的 TLS 协议版本开关。
- 路由:
POST /site - action:
get_ssl_protocol或set_ssl_protocol
get_ssl_protocol
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | get_ssl_protocol |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| TLSv1 | Boolean | TLS 1.0 开关 |
| TLSv1.1 | Boolean | TLS 1.1 开关 |
| TLSv1.2 | Boolean | TLS 1.2 开关 |
| TLSv1.3 | Boolean | TLS 1.3 开关 |
响应
{"TLSv1": false, "TLSv1.1": true, "TLSv1.2": true, "TLSv1.3": true}
set_ssl_protocol
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | set_ssl_protocol |
| TLSv1 | 否 | String | "true" / "false" |
| TLSv1.1 | 否 | String | "true" / "false" |
| TLSv1.2 | 否 | String | "true" / "false" |
| TLSv1.3 | 否 | String | "true" / "false" |
响应
{"status": true, "msg": "设置成功"}
get_view_title_contentaction=get_view_title_content获取域名推广横幅的 HTML 内容和显示状态
获取面板在域名相关页面显示的推广横幅 HTML 内容及其显示/隐藏状态。
- 路由:
POST /site - action:
get_view_title_content
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 get_view_title_content |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 显示中,false 已隐藏 |
| msg | String | 横幅 HTML 内容 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=get_view_title_content
响应
{"status": true, "msg": "<span>没有域名? 堡塔域名注册 .com低至54元...</span>"}
listaction=list获取网站漏洞扫描的缓存结果
获取最近一次网站漏洞扫描的缓存信息,包括扫描结果、漏洞数量和网站总数。
- 路由:
POST /site - action:
list
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 list |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| info | Array | 扫描结果缓存(可能为空) |
| time | Integer | 上次扫描时间戳,0 表示未扫描 |
| loophole_num | Integer | 发现的漏洞数量 |
| site_num | Integer | 网站总数 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=list
响应
{"info": [], "time": 0, "loophole_num": 0, "site_num": 1}
相关接口
- get_Scan — 获取扫描结果
logsOpenaction=logsOpen开启网站访问日志
开启网站的访问日志记录。
- 路由:
POST /site - action:
logsOpen
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 logsOpen |
| id | 是 | Integer | 网站 ID |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | 请求结果,true 表示成功 |
| msg | String | 提示信息 |
{"status": true, "msg": "操作成功"}
multiple_basediraction=multiple_basedir批量为多个网站设置防跨站攻击(open_basedir)状态
批量为多个网站开启或关闭防跨站攻击保护(PHP open_basedir 限制)。
- 路由:
POST /site - action:
multiple_basedir
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 multiple_basedir |
| site_ids | 是 | String | JSON 数组,网站 ID 列表 [1, 2, 3] |
| stat | 是 | String | "open" 开启,"close" 关闭 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| succeed | Array | 设置成功的网站列表 |
| errors | Array | 设置失败的网站列表 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=multiple_basedir&site_ids=[]&stat=open
响应
{"succeed": [], "errors": []}
multiple_limit_netaction=multiple_limit_net批量为多个网站设置流量限制
批量为多个网站设置并发连接数和流量限制。
- 路由:
POST /site - action:
multiple_limit_net
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 multiple_limit_net |
| site_ids | 是 | String | JSON 数组,网站 ID 列表 [1,2,3] |
| perserver | 是 | Integer | 每个服务器最大并发连接数 |
| perip | 是 | Integer | 每个 IP 最大并发连接数 |
| limit_rate | 是 | Integer | 每个连接限速(KB/s) |
| close_limit_net | 是 | String | "1" 关闭限制 / "0" 开启限制 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| succeed | Array | 设置成功的网站列表 |
| errors | Array | 设置失败的网站列表 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=multiple_limit_net&site_ids=[1]&perserver=100&perip=10&limit_rate=1024&close_limit_net=0
响应
{"succeed": [{"status": true, "id": 1}], "errors": []}
open_cdn_ipaction=open_cdn_ip开启 CDN IP 获取(从 X-Forwarded-For 等头获取真实 IP)
open_cdn_ip / get_cdn_ip_settings
管理网站的 CDN IP 获取配置,使网站在 CDN 后能获取真实客户端 IP。
- 路由:
POST /site - action:
open_cdn_ip或get_cdn_ip_settings
get_cdn_ip_settings
获取当前 CDN IP 配置。
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | 请求结果,true 表示成功 |
| msg | String | 提示信息 |
{
"cdn_ip": false,
"cdn_recursive": false,
"header_cdn": "X-Forwarded-For",
"white_ips": "0.0.0.0/0,::/0"
}
| 参数 | 描述 |
|---|---|
| cdn_ip | 是否开启 CDN IP 获取 |
| cdn_recursive | 是否递归获取 |
| header_cdn | 使用的 HTTP 头 |
open_cdn_ip
开启 CDN IP 获取。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | open_cdn_ip |
{"status": true, "msg": "设置成功"}
set_404_configaction=set_404_config设置网站的 404 错误页面开关
为指定网站开启或关闭自定义 404 错误页面。
- 路由:
POST /site - action:
set_404_config
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_404_config |
| siteName | 是 | String | 网站域名 |
| status | 是 | String | "1" 开启,"0" 关闭 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 修改成功 |
| msg | String | 修改成功! |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_404_config&siteName=testapi.bt.local&status=1
响应
{"status": true, "msg": "修改成功!"}
相关接口
- get_404_config — 查询 404 配置
set_create_default_confaction=set_create_default_conf设置创建网站时的默认配置项
设置新建网站时的全局默认配置,如 404 页面、默认首页等开关。
- 路由:
POST /site - action:
set_create_default_conf
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_create_default_conf |
| page_404 | 否 | String | "true" / "false",自动创建 404 页面 |
| page_index | 否 | String | "true" / "false",自动创建默认首页 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 修改成功 |
| msg | String | 修改成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_create_default_conf&page_404=true
响应
{"status": true, "msg": "修改成功"}
set_cron_scanin_infoaction=set_cron_scanin_info设置网站漏洞扫描定时任务的周期和推送渠道
配置漏洞扫描定时任务的执行周期、消息推送渠道和开关状态。
- 路由:
POST /site - action:
set_cron_scanin_info
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_cron_scanin_info |
| status | 是 | String | "1" 开启,"0" 关闭 |
| day | 是 | String | 扫描周期(天) |
| channel | 否 | String | 消息推送渠道 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_cron_scanin_info&status=1&day=1
响应
{"status": true, "msg": "设置成功"}
set_dns_domainsaction=set_dns_domains批量为域名设置 DNS API 解析记录
批量为多个域名设置 DNS API 解析记录(自动添加/更新 DNS 解析)。
- 路由:
POST /site - action:
set_dns_domains
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_dns_domains |
| domains | 是 | String | JSON 数组,域名列表 ["example.com","test.com"] |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 操作完成 |
| success_list | Array | 设置成功的域名列表 |
| err_list | Array | 设置失败的域名及错误信息 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_dns_domains&domains=["test.com"]
响应
{"status": true, "msg": "", "success_list": [], "err_list": [{"domain": "test.com", "error": "没有找到域名为test.com的有效的DNS API密钥信息"}]}
set_free_total_statusaction=set_free_total_status设置网站的免费流量限制状态
设置指定网站的免费流量限制开关,也可设为 global 进行全局配置。
- 路由:
POST /site - action:
set_free_total_status
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_free_total_status |
| site_id | 是 | String | 网站 ID,传 "global" 设置全局 |
| status | 是 | Integer | 1 开启,0 关闭 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
| msg | String | 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_free_total_status&site_id=1&status=1
响应
{"status": true, "msg": "设置成功"}
相关接口
- get_free_total_status — 查询状态
set_global_http2httpsaction=set_global_http2https设置全局 HTTP 到 HTTPS 跳转
set_global_http2https / get_https_settings
设置或获取全局 HTTP→HTTPS 跳转配置。
- 路由:
POST /site - action:
set_global_http2https
set_global_http2https
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_global_http2https |
响应
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | 请求结果,true 表示成功 |
| msg | String | 提示信息 |
{"status": true, "msg": "设置成功", "data": null, "code": 0, "timestamp": 1779444586}
set_https_modeaction=set_https_mode设置面板 HTTPS 全局模式(宽松/严格)
切换面板 HTTPS 全局模式。宽松模式下未部署 SSL 的网站仍可通过 HTTP 访问,严格模式下强制 HTTPS。
- 路由:
POST /site - action:
set_https_mode
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_https_mode |
无其他参数(切换模式,每次调用反转当前状态)。
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
| msg | String | 已开启HTTPS严格模式 或 已关闭HTTPS严格模式 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_https_mode
响应
{"status": true, "msg": "已开启HTTPS严格模式"}
set_ignore_view_domain_titleaction=set_ignore_view_domain_title设置忽略域名推广横幅(关闭面板域名推广信息)
设置忽略面板域名推广横幅,关闭后在域名相关的页面不再显示推广信息。
- 路由:
POST /site - action:
set_ignore_view_domain_title
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_ignore_view_domain_title |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_ignore_view_domain_title
响应
{"status": true, "msg": "设置成功!"}
set_restart_taskaction=set_restart_task设置 Apache/Nginx 守护进程(自动重启)任务
设置 Apache 或 Nginx 守护进程任务,在 Web 服务异常停止时自动重启。
- 路由:
POST /site - action:
set_restart_task
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_restart_task |
| status | 是 | String | "1" 开启,"0" 关闭 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_restart_task&status=0
响应
{"status": true, "msg": "设置成功!"}
相关接口
- get_restart_task — 查询守护任务状态
set_security_headersaction=set_security_headers为网站设置 HTTP 安全响应头
为指定网站配置 HTTP 安全响应头(如 X-Frame-Options、X-Content-Type-Options 等)。
- 路由:
POST /site - action:
set_security_headers
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_security_headers |
| site_name | 是 | String | 网站域名 |
| security_info | 是 | String | JSON 字符串,安全头配置,如 {"X-Frame-Options":"SAMEORIGIN"} |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
| msg | String | 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_security_headers&site_name=testapi.bt.local&security_info={"X-Frame-Options":"SAMEORIGIN"}
响应
{"status": true, "msg": "设置成功"}
set_site_etime_multipleaction=set_site_etime_multiple批量设置网站到期时间
批量为多个网站设置到期时间。
- 路由:
POST /site - action:
set_site_etime_multiple
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_site_etime_multiple |
| sites_id | 是 | String | 网站 ID,多个用逗号分隔,如 "1,2,3" |
| edate | 是 | String | 到期日期,格式 YYYY-MM-DD |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 操作完成 |
| success | Array | 设置成功的网站域名列表 |
| error | Object | 设置失败的网站及原因 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_site_etime_multiple&sites_id=1&edate=2026-12-31
响应
{"status": true, "success": ["testapi.bt.local"], "error": {}}
set_site_ignore_https_modeaction=set_site_ignore_https_mode设置网站忽略全局 HTTPS 强制跳转
设置指定网站是否忽略面板全局的 HTTPS 强制跳转规则。
- 路由:
POST /site - action:
set_site_ignore_https_mode
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_site_ignore_https_mode |
| siteName | 是 | String | 网站域名 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_site_ignore_https_mode&siteName=testapi.bt.local
响应
{"status": true, "msg": "设置成功!"}
set_sites_ftpaction=set_sites_ftp为网站快速创建或关联 FTP 账户
为指定网站创建或关联 FTP 账户。
- 路由:
POST /site - action:
set_sites_ftp
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_sites_ftp |
| siteName | 条件 | String | 网站域名(与 site_id 二选一) |
| site_id | 条件 | Integer | 网站 ID |
| ftp_name | 是 | String | FTP 用户名 |
| ftp_pwd | 是 | String | FTP 密码 |
| ftp_id | 否 | Integer | 已有 FTP 账户 ID(关联已有账户时传) |
| ftp_status | 否 | String | FTP 状态 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 操作成功 |
| info | Object | FTP 账户详情(id、name、password、path、status) |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_sites_ftp&siteName=testapi.bt.local&ftp_name=testftp&ftp_pwd=Test@123
响应
{"status": true, "msg": "添加成功", "info": {"id": 4, "pid": 1, "name": "testftp", "password": "Test@123", "path": "/www/wwwroot/testapi.bt.local", "status": "1"}}
set_sites_log_pathaction=set_sites_log_path设置网站的日志文件存储路径
设置指定网站 Web 日志的存储目录路径。
- 路由:
POST /site - action:
set_sites_log_path
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_sites_log_path |
| log_path | 是 | String | 日志目录路径,必须是已存在的目录 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_sites_log_path&log_path=/www/wwwlogs
响应
{"status": true, "msg": "设置成功"}
set_ssl_protocolaction=set_ssl_protocol设置网站的 TLS/SSL 协议版本
设置指定网站允许的 TLS 协议版本。
- 路由:
POST /site - action:
set_ssl_protocol
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 set_ssl_protocol |
| siteName | 是 | String | 网站域名 |
| protocol | 是 | String | 协议版本,如 TLSv1.0、TLSv1.1、TLSv1.2、TLSv1.3 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 设置成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=set_ssl_protocol&siteName=testapi.bt.local&protocol=TLSv1.2
响应
{"status": true, "msg": "设置成功"}
site_rnameaction=site_rname修改网站的备注名称(别名)
修改网站的备注名称/别名。
- 路由:
POST /site - action:
site_rname
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 site_rname |
| id | 是 | Integer | 网站 ID |
| rname | 是 | String | 新的备注名称 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 修改成功 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=site_rname&id=1&rname=我的网站
响应
{"status": true, "msg": "网站【testapi.bt.local】改名为:【我的网站】"}
test_domains_apiaction=test_domains_api测试域名是否已配置有效的 DNS API 密钥
检查指定域名是否已配置有效的 DNS API 密钥,用于 SSL 证书自动续签等场景。
- 路由:
POST /site - action:
test_domains_api
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 test_domains_api |
| domains | 是 | String | JSON 数组,域名列表 ["example.com"] |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| - | Array | 每个域名的检测结果对象列表 |
示例
请求
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=test_domains_api&domains=["test.com"]
响应
[{}]
返回
[{}]表示该域名未找到对应的 DNS API 密钥配置。
webserverprepaction=webserverprepWeb 服务器环境预检查
Web 服务器环境预检查,用于安装或切换 Web 服务器(Nginx/Apache/OpenLiteSpeed)前验证环境。
- 路由:
POST /site - action:
webserverprep
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 webserverprep |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 检查完成 |
| msg | String | 空字符串表示环境正常 |
示例
{"status": true, "msg": ""}