网络知识分享

哪吒监控 新版 v1

#youtube视频

https://youtu.be/DLbtsf4FmEg

#官方说明文档
https://nezha.wiki/guide/dashboard.html

#安装wget,sudo等
apt install -y curl wget sudo unzip

#官方安装脚本
curl -L https://raw.githubusercontent.com/nezhahq/scripts/refs/heads/main/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh

#安装nginx
apt install -y nginx

#证书和私钥的路径(nginx配置文件里面可以找到)
/etc/ssl/private

#证书文件名
fullchain.cer

#私钥文件名
private.key

#重启nginx
systemctl restart nginx && systemctl status nginx

#面板后台域名
你的域名/dashboard

#全国ICMP Ping监控节点地址
https://www.nodeseek.com/post-82748-1

 

#nginx配置文件

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server
{
    #listen [::]:80;   #监听端口 IPv6
    #listen [::]:443 ssl;    #监听端口 带SSL iPv6
    listen 80; #ipv4
    listen 443 ssl;  #ipv4
    server_name nezha.ashboy.top; #填写监控网站域名
    index index.php index.html index.htm default.php default.htm default.html;
    root /home/web/nezha;
    #index root部分随便写 没用的
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    ssl_certificate    /etc/ssl/private/fullchain.cer;   #SSL证书文件
    ssl_certificate_key    /etc/ssl/private/private.key;  #SSL密钥文件
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";
    error_page 497  https://$host$request_uri;
 
#以下是反代内容 如果有特别设置端口记得修改 
   
location / {
    proxy_pass http://127.0.0.1:8008;
    proxy_set_header Host $host;
    proxy_set_header Origin https://$host;
    proxy_set_header nz-realip $http_CF_Connecting_IP;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
}
location ~ ^/(ws|terminal/.+|file/.+)$ {
    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 $http_host;
}
}
}

 

相关导航

暂无评论

暂无评论...