I'm using the Meanjs boilerplate. My LetsEncrypt certs works fine on dev mode and non node applications, but I'm can't make it work on prod mode.
The following message appears when I start the application:
+ Error: Certificate file or key file is missing, falling back to non-SSL mode
To create them, simply run the following from your shell: sh ./scripts/generate-ssl-certs.sh
If I run sh ./scripts/generate-ssl-certs.sh
untrusted self-signed certs are generated, but works only if I point them into nginx configuration too. Otherwise I get 502 error on Browser. BTW I need to use trusted certs.
If I try to copy my trusted LetsEncrypt certs to application path config/sslcerts/
I'm also getting 502 error.
Cert files (links) from /etc/letsencrypt/live/domain.com/
cert.pem
chain.pem
fullchain.pem
privkey.pem
Nginx error.log:
2016/11/02 23:50:28 [error] 26186#26186: *164 upstream prematurely closed connection while reading response header from upstream, client: x.x.x.x, server: domain.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8443/", host: "domain.com"