OpenClaw-AI助手入门教程-Docker+deepseek+飞书+nginx反向代理部署流程2
5️⃣ 配置反向代理(使 Web 管理端可通过 HTTPS 访问)
5.1 准备域名及 SSL 证书
- 申请域名(如 openclaw.yourdomain.com),解析到服务器公网 IP
- 获取 SSL 证书(可自签或使用 Let's Encrypt)
5.2 安装 Nginx 并配置反向代理
- nginx配置
server {
listen 443 ssl;
server_name openclaw.yourdomain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://127.0.0.1:18789;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
5.3 配置 OpenClaw 信任代理 IP
- 编辑 ~/.openclaw/openclaw.json,在 gateway 节点添加:
json5
"gateway": {
"trustedProxies": ["172.21.0.1/32", "你的代理服务器公网IP"],
// ... 其他配置
}
#重启网关:
docker compose restart openclaw-gateway
5.4 (可选)配置自动设备配对策略
手动批准:
bash
# 查看待批准设备
docker compose exec openclaw-gateway node dist/index.js devices list
# 批准指定请求
docker compose exec openclaw-gateway node dist/index.js devices approve <请求ID>
6️⃣ 性能优化与常见问题
- ⚡ 响应速度优化(针对 DeepSeek 回复慢)
问题 解决方案 命令/配置
模型推理慢 换用 deepseek-chat config set agents.defaults.model.primary custom-api-deepseek-com/deepseek-chat
工具调用超时 关闭飞书通道工具 config set channels.feishu.toolsEnabled false
上下文过大 限制飞书上下文 config set channels.feishu.contextLimit 8000
网络延迟 使用国内 DNS 容器内 echo "nameserver 114.114.114.114" > /etc/resolv.conf
❗ 安全红线
DeepSeek API Key 一旦泄露,立即删除并重新生成
- 配置文件权限收紧:
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json
#不要在公共文档、日志中明文暴露任何密钥
常用诊断命令汇总
# 整体健康检查
docker compose exec openclaw-gateway node dist/index.js doctor
# 查看当前模型配置
docker compose exec openclaw-gateway node dist/index.js config get agents.defaults.model
# 查看飞书通道配置
docker compose exec openclaw-gateway node dist/index.js config get channels.feishu
# 实时跟踪飞书消息
docker compose logs -f openclaw-gateway | grep -E "feishu|agent"
总结
- 通过以上步骤,你已成功完成:
✅ Docker 部署 OpenClaw
✅ 接入 DeepSeek(支持 reasoner 和 chat 双模型)
✅ 集成飞书机器人(长连接,免配对)
✅ 配置 HTTPS 反向代理与设备自动批准
- 现在,你的企业飞书智能助手已正式上线!如有其他问题,欢迎查阅 OpenClaw 官方文档 或社区讨论。
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


















