certbot 服务器证书配置

cerbot

1

bash 复制代码
sudo apt update
sudo apt install python3 python3-venv libaugeas0

2

bash 复制代码
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip

3

bash 复制代码
sudo /opt/certbot/bin/pip install certbot certbot-nginx

4

bash 复制代码
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot

5

bash 复制代码
sudo certbot certonly --nginx

6 nginxx config

bash 复制代码
 server {
        listen 80;	
        server_name *****.eu;
        location / {
            # Redirect all HTTP traffic to HTTPS
            return 301 https://$host$request_uri;
        }
    }
    server {
        listen 443 ssl;
        server_name *****eu;
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
		include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_certificate /etc/letsencrypt/live/digitalshield.ydns.eu/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/digitalshield.ydns.eu/privkey.pem;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
        location / {
       	    proxy_pass http://*****;
        }
    }
相关推荐
Dovis(誓平步青云)23 分钟前
从Redis指标采集到异常告警:redis_exporter + Prometheus 完整实战
服务器·数据库·人工智能·redis·架构·prometheus·vibe coding
垂钓的小鱼12 小时前
用关联图谱做量化选股:让基本面惊喜沿着网络扩散
服务器·php·apache
Lonely 净土8 小时前
Linux 运维文件写入操作
linux·运维·服务器·文件管理
城管不管8 小时前
重生——第十一次面试之挖财一面2026.8.19已OC
java·服务器·jvm·数据库·spring·面试·职场和发展
飞英思特无线充电9 小时前
严苛场景巡检机器人的无线补能设计:点位、BMS、认证与运维边界
运维·机器人
Jimmy_jimi9 小时前
利用nginx代理完成url重定位
运维·nginx
liuyicenysabel9 小时前
多服务上线日记三:
运维·服务器·笔记·学习
吠品11 小时前
Wine 在 Linux 上运行 Windows 软件完整指南
java·linux·服务器
一只鹿鹿鹿11 小时前
大数据中心安全系统解决方案(Word文件)
大数据·运维·物联网·安全·政务
AuTumn-L13 小时前
使用 SSH 密钥认证实现安全免密登录
服务器·安全·ssh