我在Ubuntu上部署了我的Python Flask应用程序,我正在使用Gunicorn和nginx。
我仔细阅读了本教程
Digital Ocean tutorial on Flask deplyment using Gunicorn and Nginx
但有时我的应用程序停止并生成500错误或502错误,直到我通过执行systemctl restart app重新启动.sock文件
当我检查错误日志时,我看到了
2016/10/20 23:37:18 [crit] 12366#12366: *47260 connect() to unix:/home/myusername/myapp/myapp.sock failed (2: No such file or directory) while connecting to upstream, client: 78.206.179.140, server: 000.111.222.333, request: "GET /goods HTTP/1.1", upstream: "http://unix:/home/myusername/myapp/myapp.sock:/live-calls", host: "000.111.222.333", referrer: "http://000.111.222.333/goods"
有时我在读取上游错误时会过早地关闭连接。