Internal Server Error 各位哥哥姐姐帮帮看下
运行环境 服务器操作系统:Ubuntu Server 16.04.1 LTS 64 位 项目开发部署方案:Falsk + nginx + uwsgi 在 python3.6 虚拟环境下运行的
本地测试可以访问,部署上云服务器之后出现了这种问题。 然后查看了 logs 错误输出日志,发现报错如下: --- no python application found, check your startup logs for errors --- [pid: 4757|app: -1|req: -1/1] 139.214.254.164 () {40 vars in 841 bytes} [Wed Jun 13 22:42:12 2018] GET / => generated 0 bytes in 3 msecs (HTTP/1.1 500) 2 headers in 0 bytes (0 switches on core 0) Wed Jun 13 22:42:12 2018 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET / (139.214.254.164) --- no python application found, check your startup logs for errors --- [pid: 4756|app: -1|req: -1/2] 139.214.254.164 () {40 vars in 841 bytes} [Wed Jun 13 22:42:12 2018] GET / => generated 0 bytes in 32 msecs (HTTP/1.1 500) 2 headers in 0 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 4757|app: -1|req: -1/3] 139.214.254.164 () {38 vars in 845 bytes} [Wed Jun 13 22:42:12 2018] GET /favicon.ico => generated 21 bytes in 27 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) spawned uWSGI worker 4 (pid: 4759, cores: 1) spawned WSGI worker 5 (pid: 4760, cores: 1
然后我多次在网上查询,大多说是 uwsgi 配置问题,我没有检查出来,所以这里也把配置贴出来罢
[uwsgi]
chdir = /srv/webtest
module = demo
home = /root/.virtualenvs/benmoom-env-py3
master = true
processes = 10
socket = /srv/webtest/benmoom.sock
wsgi-file = /srv/webtest/demo.py
callable = app
chmod-socket = 666
vacuum = true
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.