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://*****;
        }
    }
相关推荐
fruge1 天前
Ubuntu服务器已下载Nginx安装包的安装指南
服务器·nginx·ubuntu
Do_GH1 天前
【Linux】07.Ubuntu开发环境部署
linux·运维·ubuntu
勤源科技1 天前
全链路智能运维中的实时流处理架构与状态管理技术
运维·架构
tryCbest1 天前
Linux使用Docker部署项目后期更新
linux·运维·docker
孤独得猿1 天前
聊天室项目开发——etcd的安装和使用
linux·服务器·c++·etcd
竹等寒1 天前
Linux-网络安全私房菜(二)
linux·服务器·web安全
早睡冠军候选人1 天前
Ansible学习----Ansible Playbook
运维·服务器·学习·云原生·容器·ansible
sulikey1 天前
从实验出发深入理解Linux目录权限:r、w、x分别控制什么?能否进入目录到底由谁决定?
linux·运维·服务器·ubuntu·centos
li3714908901 天前
nginx报400bad request 请求头过大异常处理
java·运维·nginx
久曲健的测试窝1 天前
Jenkins Share Library教程 —— 开发入门
运维·servlet·jenkins