nginx ssl

Last updated on November 22, 2024 pm

🧙 Questions

☄️ Ideas

使用freessl配置ssl

登录账号,输入域名 isxcode.com,选择品牌

20220706144148

20220706155651

20220706144341

配置域名认证

20220706144456

20220706144636

20220706144729

校验

20220706144818

20220706145006

通过certbot安装

默认下载路径 /etc/letsencrypt/archive/isxcode.com/
NOTE:
命令中取消 www.isxcode.com

sudo yum install -y certbot
sudo pip uninstall urllib3
sudo pip install urllib3==1.21.1
sudo pip install --upgrade --force-reinstall 'requests==2.6.0'
sudo certbot certonly --manual -d isxcode.com --server https://acme.freessl.cn/v2/DV90/directory/b2s82ileo16ty8uzgg8k
sudo chown -R ispong:ispong /etc/letsencrypt/archive/

20220706160854

将密钥文件复制到指定路径

cp /etc/letsencrypt/archive/isxcode.com/fullchain1.pem /data/ssl/isxcode.com/full_chain.pem
cp /etc/letsencrypt/archive/isxcode.com/privkey1.pem /data/ssl/isxcode.com/private.key

配置nginx.conf

vim /etc/nginx/nginx.conf
http {
    server {
        listen             80;
        server_name        isxcode.com;
        rewrite ^(.*)$ https://${server_name}$1 permanent;
    }

    server {
        listen              443 ssl;
        server_name         isxcode.com;
        ssl_certificate     /data/ssl/isxcode.com/full_chain.pem;
        ssl_certificate_key /data/ssl/isxcode.com/private.key;
        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers         HIGH:!aNULL:!MD5;

        location / {
            root   /usr/share/nginx/html/blog/public/;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }
    }
}

手动续约

sudo certbot renew --dry-run

使用阿里云配置ssl

创建证书

20220706152020

20220706152034

20220706152121

20220706152208

20220706152225


nginx ssl
https://ispong.isxcode.com/vue/nginx/nginx ssl/
Author
ispong
Posted on
March 3, 2022
Licensed under