https 自动续签

我的系统是 Alibaba Cloud Linux 3​​ 
sudo dnf install epel-release --allowerasing -y

下图显示表示安装成功!
https 自动续签_第1张图片

把certbot变成全局命令

sudo ln -s /usr/bin/certbot /usr/local/bin/certbot
# 测试是否安装成功
certbot --version

在这里插入图片描述

运行certbot

# 但在运行 sudo certbot --nginx 时提示 ​​nginx 插件未安装​​
sudo yum install certbot-nginx
sudo certbot --nginx

nginx 配置


user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;


include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    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  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 4096;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;


    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80;
        listen       [::]:80;
        # 添加你的域名
        server_name  printboy.space;
        root         /usr/share/nginx/html;

   
        include /etc/nginx/default.d/*.conf;

        # 让 Certbot 能访问验证文件
        location /.well-known/acme-challenge/ {
             allow all;
        }
        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }



}


自动续签

certbot renew --dry-run

你可能感兴趣的:(https,网络协议,http)