nginx: [emerg] PEM_read_bio_X509_AUX("/path/ssl-bundle.crt") failed (SSL: error:09FFF066:PEM routines:CRYPTO_internal:bad end line)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
申请了gogetssl 的comodo免费证书,根据https://support.comodo.com/index.php?/Knowledgebase/Article/View/1091/37/certificate-installation--nginx 提示
cat domain_com.crt domain_com.ca-bundle > ssl-bundle.crt
首先要将文件合并起来,这里就出问题了,使用nginx -t 验证文件就会报错
原因是缺少一个换行符
仔细找ssl-bundle.crt 中是不是出现了这一行
-----END CERTIFICATE----------BEGIN CERTIFICATE-----
出现错误是合并在一行了,加个换行就可以了
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----