作者的Github仓库

https://github.com/naiba/nezha

中文文档:哪吒监控 (nezha.wiki)

注册Github

然后创建一个OAuth Apps
打开:https://github.com/settings/developers

新创建,填入

https://你的域名
https://你的域名/oauth2/callback

OK

创建完成后,能看到OAuth AppsClient ID,随后再创建一个Client secrets,记事本保存备用。

安装哪吒面板

国外机器用

curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh

国内机器用

curl -L https://raw.sevencdn.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh

配置监控端与被监控端

监控端网站的反向代理配置

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;
}
location /terminal
{
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;
}

被监控端的安装

运行安装代码

选择第8:安装监控Agent

填入域名,端口和密钥即可。

注意:添加多个被监控端,域名和端口都是一样的,就密钥改变。

当个备忘录。

最后修改:2023 年 06 月 01 日
如果觉得我的文章对你有用,请随意赞赏