From 7965c234dffece6439780a699b139c922f99a760 Mon Sep 17 00:00:00 2001 From: JianMiau Date: Thu, 16 Apr 2026 07:34:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20SSL=20=E6=86=91=E8=AD=89?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5=E6=8F=9B=E8=A1=8C=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/nginx/entrypoint.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docker/nginx/entrypoint.sh b/docker/nginx/entrypoint.sh index dd9f7c7..9f4881f 100644 --- a/docker/nginx/entrypoint.sh +++ b/docker/nginx/entrypoint.sh @@ -36,10 +36,28 @@ build_cert_bundle() { exit 1 fi - cat "${cert_path}" "${chain_path}" > "${GENERATED_CERT_PATH}" + normalize_pem_file "${cert_path}" > "${GENERATED_CERT_PATH}" + normalize_pem_file "${chain_path}" >> "${GENERATED_CERT_PATH}" cp "${key_path}" "${GENERATED_KEY_PATH}" } +normalize_pem_file() { + pem_path="$1" + + awk ' + { + sub(/\r$/, "") + print + has_content = 1 + } + END { + if (has_content) { + print "" + } + } + ' "${pem_path}" +} + write_nginx_config() { cat > /etc/nginx/conf.d/default.conf <