nginx 502-Bad gateway

前两天没及时续费阿里云服务器,续费后遇到ghost博客打不开了,记录一下问题解决.

出现了问题如标题,首先查看一下nginx的error.log ,如下:

connect() failed (111: Connection refused) while connecting to upstream, client: 121.28.144.94, server: www.longhe.xin, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:2368/", host: "www.longhe.xin"

查看forever下ghost是否运行

$ forever list

问题:发现ghost未运行,  

解决:进入ghost目录下(内有index.js),执行一下,forever设置ghost始终启动

$ NODE_ENV=production forever start index.js

尾语:  用了小半天才找到的问题,各种百度,谷歌,仅此记录一下吧,也希望其他人遇到了能帮助到.

你可能感兴趣的:(nginx 502-Bad gateway)