From c0c32e7f7829ffba3b603032e019563f59f88e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E8=89=B3zy?= <3599630858@qq.com> Date: Mon, 24 Jun 2024 18:00:45 +0800 Subject: [PATCH] =?UTF-8?q?20240622-=E8=BF=9B=E7=A8=8B=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20240607-SSL\350\257\201\344\271\246.md" | 51 +++++++++++++++++++ ...21\347\273\234\347\256\241\347\220\206.md" | 0 2 files changed, 51 insertions(+) create mode 100644 "39 \345\221\250\350\211\263/note/20240607-SSL\350\257\201\344\271\246.md" create mode 100644 "39 \345\221\250\350\211\263/note/20240622-\347\275\221\347\273\234\347\256\241\347\220\206.md" diff --git "a/39 \345\221\250\350\211\263/note/20240607-SSL\350\257\201\344\271\246.md" "b/39 \345\221\250\350\211\263/note/20240607-SSL\350\257\201\344\271\246.md" new file mode 100644 index 0000000..50daa3f --- /dev/null +++ "b/39 \345\221\250\350\211\263/note/20240607-SSL\350\257\201\344\271\246.md" @@ -0,0 +1,51 @@ +#### SSL证书的部署 + +##### 证书的获取 + +1. 在自己的服务器控制台中找到自己需要安装的证书并下载 + +2. 下载好后解压缩,需要后缀为.key,.crt的文件 + +3. vim `/etc/nginx/nginx.conf` 命令行编辑该文件(我的是conf.d文件) + +4. 里面存在的内容不要修改他 + + ```bash + server { + #SSL 默认访问端口号为 443 + listen 443 ssl; + #请填写绑定证书的域名 + server_name cloud.tencent.com; + #请填写证书文件的相对路径或绝对路径 + ssl_certificate cloud.tencent.com_bundle.crt; + #请填写私钥文件的相对路径或绝对路径 + ssl_certificate_key cloud.tencent.com.key; + ssl_session_timeout 5m; + #请按照以下协议配置 + ssl_protocols TLSv1.2 TLSv1.3; + #请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。 + ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; + ssl_prefer_server_ciphers on; + location / { + #网站主页路径。此路径仅供参考,具体请您按照实际目录操作。 + #例如,您的网站主页在 Nginx 服务器的 /etc/www 目录下,则请修改 root 后面的 html 为 /etc/www。 + root html; + index index.html index.htm; + } + } + + ``` + +5. 验证配置文件问题 + + ```bash + nginx -t + ``` + +6. 重载Nginx + + ```bash + nginx -s reload + ``` + + \ No newline at end of file diff --git "a/39 \345\221\250\350\211\263/note/20240622-\347\275\221\347\273\234\347\256\241\347\220\206.md" "b/39 \345\221\250\350\211\263/note/20240622-\347\275\221\347\273\234\347\256\241\347\220\206.md" new file mode 100644 index 0000000..e69de29 -- Gitee