面板的github:https://github.com/naiba/nezha
1、安装面板
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh
sudo ./nezha.sh
github创建一个Oauth Apps,获取ID和秘钥,然后填好解析的域名。
输入刚才创建的Oauth App 的ID:xxxxxxxxxxxxxx和密码xxxxxxxxxxxxxxxxxxxxxx
防火墙放行8008 5555 端口,此时已经可以通过端口访问到监控面板。
反代、SSL
反代配置:
location /
{
proxy_pass http://127.0.0.1:8008;
proxy_set_header Host $host;
}
location /ws
{
proxy_pass http://127.0.0.1:8008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
反代后可以通过ssl来实现https访问。然后就在导github的Oauth Apps里改回https和删掉端口号。
面板的程序到这里就结束了,后面我们配置监控服务器。
监控主机配置
先在面板端添加一台服务器
去客户端,复制命令即可
最后就能看到监控的面板信息了