准备工作
- 系统版本:Ubuntu 22.04
- 域名配置A记录,如:nezha.xxx.com
apt install nginx
apt install certbot python3-certbot-nginx unzip
安装 Dashboard
curl -L https://raw.githubusercontent.com/nezhahq/scripts/refs/heads/main/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
配置web及证书
- 添加 nezha.xxx.com web配置,如下:
/etc/nginx/sites-available/nezha.xxx.com
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name nezha.xxx.com;
location / {
try_files $uri $uri/ =404;
}
}
-
申请证书 certbot —nginx -d nezha.xxx.com
-
然后到Nezha官网拷贝反向代理改成自己的配置
Nezha官网面板反向代理配置
Certbot 证书自动续订
systemctl status certbot.timer
certbot renew —dry-run