Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Docker Nginx
Commits
578a9a02
Commit
578a9a02
authored
Jun 19, 2022
by
name
Browse files
修改默认使用"fullchain.pem",避免"错误: 服务器缺少中间证书"
parent
82244935
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
578a9a02
...
...
@@ -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
;
# 证书自动安装的路径
# ...
...
...
default.conf
View file @
578a9a02
...
...
@@ -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
;
...
...
docker-entrypoint.sh
View file @
578a9a02
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment