---
title: "更新站点"
method: PUT
path: "/api/v1/site/{id}"
tags: ["站点管理"]
---

# 更新站点

`PUT /api/v1/site/{id}`

更新指定站点的配置

## Path parameters

- `id` string, required

## Request body

- DtoUpdateSiteRequest — 更新站点的请求参数
  - `activeStatus` boolean — 站点状态
  - `backend` DtoBackendDTO
    - `servers` DtoServerDTO[], required — 服务器列表，至少需要一个服务器
      - `host` string, required — 主机地址
      - `isSSL` boolean — 是否启用SSL
      - `port` integer, required — 端口
  - `certificate` DtoCertificateDTO
    - `certName` string, required — 证书名称
    - `expireDate` string, required — 过期时间
    - `fingerPrint` string, required — 证书指纹
    - `issuerName` string, required — 颁发机构
    - `privateKey` string, required — 私钥内容
    - `publicKey` string, required — 公钥内容
  - `domain` string — 域名
  - `enableHTTPS` boolean — 是否启用HTTPS
  - `listenPort` integer — 监听端口
  - `name` string — 站点名称
  - `wafEnabled` boolean — 是否启用WAF
  - `wafMode` 'protection' | 'observation' — WAF模式

## Response `200`

站点更新成功

- object — 成功的API响应标准格式
  - `code` integer
  - `data` DtoSiteResponse — 站点信息响应
    - `activeStatus` boolean — 站点是否激活
    - `backend` ModelBackend
      - `servers` ModelServer[] — 服务器列表
        - `host` string — 主机地址，如 IP 或域名
        - `isSSL` boolean — 是否启用SSL
        - `port` integer — 端口
    - `certificate` ModelCertificate
      - `certName` string — 证书名称/别名
      - `expireDate` string — 证书过期日期
      - `fingerPrint` string — 证书指纹
      - `issuerName` string — 颁发机构
      - `privateKey` string — 私钥内容（PEM格式）
      - `publicKey` string — 公钥内容（PEM格式）
    - `createdAt` string
    - `domain` string — 域名，如 a.com
    - `enableHTTPS` boolean — 是否启用HTTPS
    - `id` string — 站点ID
    - `listenPort` integer — 监听端口，如 9000
    - `name` string — 站点名称
    - `updatedAt` string
    - `wafEnabled` boolean — 是否启用WAF
    - `wafMode` 'protection' | 'observation'
  - `message` string
  - `requestId` string
  - `success` boolean
  - `timestamp` string

## Other responses

- `400` — 请求参数错误
- `401` — 未授权访问
- `403` — 禁止访问
- `404` — 站点不存在
- `409` — 域名和端口组合已被其他站点使用
- `500` — 服务器内部错误

---

[API](https://skmtc.net/labring/apis/ruiqi-waf-api.md) · [All operations](https://skmtc.net/labring/apis/ruiqi-waf-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/labring/ruiqi-waf-api/revisions/aaacd7e06a88/schema)
