必须通过Nginx反向代理实现HTTPS,因AionClaw自身不支持证书管理或TLS终止;需先确认其HTTP服务端口(如8080),再配置Nginx监听443端口、加载SSL证书并proxy_pass至该端口。
☞☞☞AI 智能聊天, 问答助手, AI 智能搜索, 多模态理解力帮你轻松跨越从0到1的创作门槛☜☜☜

要让AionClaw生成的网站支持HTTPS访问,必须绕过它默认的HTTP本地服务模式,将流量导入具备TLS终止能力的反向代理层——因为AionClaw自身不提供证书管理、端口监听切换或ACME自动续签功能,直接修改其内置Web服务器配置不仅无效,还会在下次升级时被覆盖。
确认AionClaw网站服务运行状态
打开AionClaw客户端 → 左侧导航点击【自动化 (RPA)】→ 顶部搜索栏输入“启动静态网站”并运行对应技能。技能执行完成后,在终端日志中查找类似 【http://127.0.0.1:8080】 的地址行,确认服务已绑定到明确端口(如8080、3000等),且未启用 --https 或 --tls 参数——这说明它当前纯HTTP运行,是后续反代的前提。
若日志中出现 bind: address already in use 或 EADDRINUSE 错误,请先用 lsof -i :8080(macOS/Linux)或 netstat -ano | findstr :8080(Windows)查杀占用进程,否则Nginx/Apache无法接管该端口。
准备SSL证书文件
方法一:使用Let’s Encrypt免费证书(推荐用于有域名的生产环境)
在服务器上安装 Certbot:sudo apt install certbot python3-certbot-nginx(Ubuntu/Debian)或 sudo yum install certbot python3-certbot-nginx(CentOS/RHEL)。
执行 sudo certbot --nginx -d your-domain.com,Certbot会自动申请证书、修改Nginx配置并启用HTTPS重定向。
【证书路径固定为 /etc/letsencrypt/live/your-domain.com/fullchain.pem 和 privkey.pem,不可随意移动】
方法二:自签名证书(仅限内网测试)
运行命令:openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem,生成 cert.pem 和 key.pem 两个文件,存放于任意可读目录(如 /opt/aionclaw-ssl/)即可。
配置Nginx反向代理
第一步:安装并启用Nginx
Ubuntu/Debian执行:sudo apt update && sudo apt install nginx && sudo systemctl enable nginx;CentOS/RHEL执行:sudo yum install epel-release && sudo yum install nginx && sudo systemctl enable nginx。
第二步:创建站点配置文件
执行 sudo nano /etc/nginx/sites-available/aionclaw-https,写入以下内容(请将 your-domain.com 替换为实际域名,8080 替换为AionClaw实际监听端口):
server {
listen 443 ssl http2;
server_name your-domain.com;
ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
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;
}
}
server {
listen 80;
server_name your-domain.com;
return 301 https://$server_name$request_uri;
}
第三步:启用配置并重启
执行 sudo ln -sf /etc/nginx/sites-available/aionclaw-https /etc/nginx/sites-enabled/ → sudo nginx -t(验证语法)→ sudo systemctl restart nginx。
第四步:开放防火墙端口
Ubuntu/Debian执行:sudo ufw allow 'Nginx Full';CentOS/RHEL执行:sudo firewall-cmd --permanent --add-service=https && sudo firewall-cmd --permanent --add-service=http && sudo firewall-cmd --reload。
验证HTTPS是否生效
在浏览器中访问 https://your-domain.com(非 http),观察地址栏是否显示锁形图标且无“不安全”提示。若页面空白或报502 Bad Gateway,请检查AionClaw服务是否仍在运行、Nginx日志 sudo tail -f /var/log/nginx/error.log 中是否有 connection refused 报错——这说明 proxy_pass 指向的端口无服务响应。
若证书提示“您的连接不是私密连接”,说明浏览器加载的是系统默认证书而非你配置的 fullchain.pem,需重新核对 Nginx 配置中 ssl_certificate 路径是否拼写错误或权限不足(Nginx 进程需有读取证书文件的权限)。


















