I generated my SSL from SSLforFree/ZeroSSL, and according to the steps for installation listed on their website, https://zerossl.com/help/installation/nginx/
cat certificate.crt ca_bundle.crt >> certificate.crt)ssl on;ssl_certificate /etc/ssl/certificate.crt;ssl_certificate_key /etc/ssl/private.key;sudo service nginx restart)journalctl -xe)nginx: [emerg] PEM_read_bio_X509_AUX(SSL: error:0908F066:PEM routines:get_header_and_data:bad end line)Merging files with cat certificate.crt ca_bundle.crt >> certificate.crt, merges the file without adding any next line character in it.
After merging the files, open the newly created file, i.e, certificate.crt, and you'll see the file structure as follows:
-----BEGIN CERTIFICATE-----
certificate-1-text
-----END CERTIFICATE----------BEGIN CERTIFICATE-----
certificate-2-text
-----END CERTIFICATE-----
If your certificate looks like this, you can fix this by adding adding a new line character just before 5 hyphens of second begin certificate, i.e, it should look as follows after editing:
-----BEGIN CERTIFICATE-----
certificate-1-text
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
certificate-2-text
-----END CERTIFICATE-----