Commit 578a9a02 authored by name's avatar name
Browse files

修改默认使用"fullchain.pem",避免"错误: 服务器缺少中间证书"

parent 82244935
......@@ -73,7 +73,7 @@ nginx配置方法如下:
root /data/web/www;
ssl_stapling off;
ssl_certificate /etc/nginx/ssl/cert.pem; # 证书自动安装的路径
ssl_certificate /etc/nginx/ssl/fullchain.pem; # 证书自动安装的路径
ssl_certificate_key /etc/nginx/ssl/key.pem; # 证书自动安装的路径
# ...
......
......@@ -6,7 +6,7 @@ server {
listen 443 ssl;
ssl_stapling off;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate /etc/nginx/ssl/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
return 403;
......
......@@ -20,13 +20,13 @@ mkdir -p ${SSL_DIR}/
function CreateDefault() {
# true if the file exists and is not empty
if [ -s "${SSL_DIR}/cert.pem" ]; then
if [ -s "${SSL_DIR}/fullchain.pem" ]; then
echo "[$(date)] default cert exists in :${SSL_DIR}"
else
echo "[$(date)] create default cert to :${SSL_DIR}"
openssl req -x509 -newkey rsa:4096 -nodes -days 365 \
-subj "/C=CA/ST=QC/O=Company Inc/CN=example.com" \
-out ${SSL_DIR}/cert.pem \
-out ${SSL_DIR}/fullchain.pem \
-keyout ${SSL_DIR}/key.pem
chmod +w ${SSL_DIR}/*
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment