腾讯云域名https申请配置Centos+nginx
- 2020 年 3 月 8 日
- 筆記
1.到腾讯云ssl页面:申请免费ssl证书
https://console.cloud.tencent.com/ssl

一步一步走,申请成功之后,等一段时间(我的没超过一小时)。可以下载
2.把下载下来的证书上传到服务器
两个文件:
.cn_bundle.crt .cn.key
3.配置nginx
server { listen 443; server_name 域名; root /home/xm/public; index index.php index.html index.htm; ssl on; # 开启ssl证书访问 ssl_certificate /xm.cn_bundle.crt;//地址 ssl_certificate_key /xm.cn.key;//地址 ssl_session_timeout 10m; # session有效期10分钟 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # 协议版本 按照这个协议配置 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php$query_string; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ .php$ { try_files $uri =404; fastcgi_pass unix:/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }