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

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

parent 82244935
...@@ -73,7 +73,7 @@ nginx配置方法如下: ...@@ -73,7 +73,7 @@ nginx配置方法如下:
root /data/web/www; root /data/web/www;
ssl_stapling off; 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; # 证书自动安装的路径 ssl_certificate_key /etc/nginx/ssl/key.pem; # 证书自动安装的路径
# ... # ...
......
...@@ -6,7 +6,7 @@ server { ...@@ -6,7 +6,7 @@ server {
listen 443 ssl; listen 443 ssl;
ssl_stapling off; 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; ssl_certificate_key /etc/nginx/ssl/key.pem;
return 403; return 403;
......
...@@ -20,13 +20,13 @@ mkdir -p ${SSL_DIR}/ ...@@ -20,13 +20,13 @@ mkdir -p ${SSL_DIR}/
function CreateDefault() { function CreateDefault() {
# true if the file exists and is not empty # 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}" echo "[$(date)] default cert exists in :${SSL_DIR}"
else else
echo "[$(date)] create default cert to :${SSL_DIR}" echo "[$(date)] create default cert to :${SSL_DIR}"
openssl req -x509 -newkey rsa:4096 -nodes -days 365 \ openssl req -x509 -newkey rsa:4096 -nodes -days 365 \
-subj "/C=CA/ST=QC/O=Company Inc/CN=example.com" \ -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 -keyout ${SSL_DIR}/key.pem
chmod +w ${SSL_DIR}/* chmod +w ${SSL_DIR}/*
fi 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