Path: API › 网站管理

`POST /site`

为指定网站开启 SSL（HTTPS），兼容 Nginx/Apache 以及 PHP/Node/Java/Go 等多种项目类型。

## Request body

_Required._

- `action269.request_time` (string, required) — Unix 时间戳。
- `action269.request_token` (string, required) — 按 API 概览生成的签名。
- `action269.action` (string, required) — 具体操作名称。
  - one of `"SetSSLConf"`
- `action269.siteName` (string, required) — 网站域名
- `action269.first_domain` (string, optional) — 主域名（批量部署时传）
- `action269.isBatch` (string, optional) — 批量部署标记

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "SetSSLConf",
  "siteName": "string",
  "first_domain": "string",
  "isBatch": "string"
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/site" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=SetSSLConf" \
  --data-urlencode "siteName=<siteName>"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
{
  "status": true,
  "msg": "SSL开启成功!",
  "csr": "-----BEGIN CERTIFICATE-----\n..."
}
```

- `action269.response.default.status` (boolean, optional) — `true` 开启成功
- `action269.response.default.msg` (string, optional) — `SSL开启成功!`
- `action269.response.default.csr` (string, optional) — PEM 格式证书内容


## SetSSLConf

为指定网站开启 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
```

### 响应

```json
{"status": true, "msg": "SSL开启成功!", "csr": "-----BEGIN CERTIFICATE-----\n..."}
```

