跳到主要内容
版本:latest

create

创建反向代理站点,生成 Nginx 配置文件、写入数据库、添加防火墙规则。

  • 路由POST /mod/proxy/com/create/stype
  • actioncreate

输入参数

参数名称必选类型描述
domainsstring域名列表,多个用换行符分隔,可带端口如 example.com:8080
proxy_pathstring代理路径,默认 /
proxy_passstring代理目标 URL,http://https:// 开头
proxy_hoststring代理 Host 头,默认 $http_host
proxy_typestring代理类型,http(默认)或 unix
remarkstring备注
备注

主域名不能为泛解析(包含 *)。代理目标为 https:// 时会自动开启 SNI。 若站点名已存在,会自动追加端口号后缀。

输出参数

参数名称类型描述
statusbool操作结果
msgstring提示信息

示例

请求

curl -X POST "http://192.168.168.213:8888/mod/proxy/com/create/stype" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "domains=api.example.com&proxy_pass=http://127.0.0.1:3000&proxy_path=/&remark=API服务&request_time=...&request_token=..."

响应

{
"status": true,
"msg": "反向代理项目添加成功!"
}