Path: API › Proxy 反向代理

`POST /mod/proxy/com/{action}/stype`

以下 API 用于对特定 `proxy_path` 设置独立的缓存、Gzip 和自定义 Nginx 配置。

## Path parameters

- `action` (`action226.path.action`; string, required) — 具体操作名称，参见下方原始接口文档。

## Request body

_Required._

- `request_time` (`action226.request_time`; string, required) — Unix 时间戳。
- `request_token` (`action226.request_token`; string, required) — 按 API 概览生成的签名。
- `site_name` (`action226.site_name`; string, required) — 站点名称
- `proxy_path` (`action226.proxy_path`; string, required) — 代理路径
- `cache_status/d` (`action226.cache_status/d`; integer, required) — 1 开启，0 关闭
- `cache_suffix` (`action226.cache_suffix`; string, required) — 缓存的文件后缀，如 `css,js,jpg,jpeg,gif,png`
- `expires` (`action226.expires`; string, optional) — 缓存过期时间，默认 `1d`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "site_name": "string",
  "proxy_path": "string",
  "cache_status/d": 0,
  "expires": "string",
  "cache_suffix": "string"
}
```

## Code samples

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

```bash
curl --request POST \
  --url "https://your-panel.example.com:8888/mod/proxy/com/<action>/stype" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "site_name=<site_name>" \
  --data-urlencode "proxy_path=<proxy_path>" \
  --data-urlencode "cache_status/d=<cache_status/d>" \
  --data-urlencode "cache_suffix=<cache_suffix>"
```

## Responses

### default

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

#### Example

```json
{
  "code": 0,
  "status": true,
  "msg": "设置成功！"
}
```


## set_url_cache / set_url_gzip / set_url_custom_conf

## URL 级别配置

以下 API 用于对特定 `proxy_path` 设置独立的缓存、Gzip 和自定义 Nginx 配置。

- **路由**：`POST /mod/proxy/com/{action}/stype`

---

## set_url_cache — 设置 URL 级别缓存

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| site_name | 是 | string | 站点名称 |
| proxy_path | 是 | string | 代理路径 |
| cache_status/d | 是 | int | 1 开启，0 关闭 |
| expires | 否 | string | 缓存过期时间，默认 `1d` |
| cache_suffix | 是 | string | 缓存的文件后缀，如 `css,js,jpg,jpeg,gif,png` |

### 响应
```json
{"code": 0, "status": true, "msg": "设置成功！"}
```

---

## set_url_gzip — 设置 URL 级别 Gzip

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| site_name | 是 | string | 站点名称 |
| proxy_path | 是 | string | 代理路径 |
| gzip_status/d | 是 | int | 1 开启，0 关闭 |

### 响应
```json
{"code": 0, "status": true, "msg": "设置成功！"}
```

---

## set_url_custom_conf — 设置 URL 级别自定义配置

### 输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| site_name | 是 | string | 站点名称 |
| proxy_path | 是 | string | 代理路径 |
| custom_conf | 是 | string | Nginx 自定义配置内容 |

### 响应
```json
{"code": 0, "status": true, "msg": "设置成功！"}
```

