反代及 SSL 申请记录帖
安装Nginx
sudo apt update
sudo apt install nginx
Nginx配置
server {
listen 80;
server_name sub.996616.xyz;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
检查配置文件是否正确
sudo nginx -t
重新加载 NGINX 使新配置生效
sudo systemctl reload nginx
设置 SSL 证书安装Let ‘sEncrypt
sudo apt install certbot python3-certbot-nginx
使用 certbot 自动配置证书
sudo certbot --nginx -d ssl.996616.xyz
安装Nginx
sudo apt update
sudo apt install nginx
Nginx配置
server {
listen 80;
server_name sub.996616.xyz;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
检查配置文件是否正确
sudo nginx -t
重新加载 NGINX 使新配置生效
sudo systemctl reload nginx
设置 SSL 证书安装Let ‘sEncrypt
sudo apt install certbot python3-certbot-nginx
使用 certbot 自动配置证书
sudo certbot --nginx -d ssl.996616.xyz