在Express(MEANJS)生产模式下使用LetsEncrypt SSL证书

我正在使用Meanjs样板。 我的LetsEncrypt证书可以在开发模式和非节点应用上正常工作,但是我不能使它在prod模式下工作。

我启动应用程序时出现以下消息:

+ 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 

如果我运行sh ./scripts/generate-ssl-certs.sh不受信任的自签名证书生成,但只有在我将它们指向nginxconfiguration时才起作用。 否则,我在浏览器上得到502错误。 顺便说一句,我需要使用可信任的证书。

如果我尝试复制我信任的LetsEncrypt证书到应用程序pathconfig/sslcerts/我也得到502错误。

来自/etc/letsencrypt/live/domain.com/证书文件(链接)

 cert.pem chain.pem fullchain.pem privkey.pem 

Nginx的错误.log:

 2016/11/02 23:50:28 [error] 26186#26186: *164 upstream prematurely closed connection while reading response header from upstream, client: xxxx, server: domain.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8443/", host: "domain.com"