Path: API › 网站管理

`POST /site`

获取新建网站时的全局默认配置状态，包括 404 页面、默认首页、日志切割、CDN IP 获取等开关。

## Request body

_Required._

- `request_time` (`action275.request_time`; string, required) — Unix 时间戳。
- `request_token` (`action275.request_token`; string, required) — 按 API 概览生成的签名。
- `action` (`action275.action`; string, required) — 具体操作名称。
  - one of `"create_default_conf"`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "create_default_conf"
}
```

## Code samples

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

```bash
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=create_default_conf"
```

## Responses

### default

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

#### Example

```json
{
  "page_404": true,
  "page_index": true,
  "log_split": false,
  "cdn_ip": false,
  "cdn_recursive": false,
  "log_path": "/www/wwwlogs"
}
```

- `page_404` (`action275.response.default.page_404`; boolean, optional) — 是否自动创建 404 页面
- `page_index` (`action275.response.default.page_index`; boolean, optional) — 是否自动创建默认首页
- `log_split` (`action275.response.default.log_split`; boolean, optional) — 是否开启日志切割
- `cdn_ip` (`action275.response.default.cdn_ip`; boolean, optional) — 是否获取 CDN IP
- `cdn_recursive` (`action275.response.default.cdn_recursive`; boolean, optional) — CDN 递归获取
- `log_path` (`action275.response.default.log_path`; string, optional) — 日志存储路径


## create_default_conf

获取新建网站时的全局默认配置状态，包括 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
```

### 响应

```json
{"page_404": true, "page_index": true, "log_split": false, "cdn_ip": false, "cdn_recursive": false, "log_path": "/www/wwwlogs"}
```

