使用uWSGI+Nginx部署Flask应用,不成功

2012-11-28 16:50:09 +08:00
 jmania
uwsgi启动后
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x7fe603c0b1f0 pid: 1228 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1228)
spawned uWSGI worker 1 (pid: 1229, cores: 1)
spawned uWSGI worker 2 (pid: 1230, cores: 1)
spawned uWSGI worker 3 (pid: 1231, cores: 1)
spawned uWSGI worker 4 (pid: 1232, cores: 1)

页面显示
502 Bad Gateway

uwsgi输出
invalid request block size: 4665 (max 4096)...skip
Wed Nov 28 16:45:14 2012 - error parsing request

nginx log:
2012/11/28 16:47:51 [error] 1240#0: *25 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "localhost"
2012/11/28 16:47:51 [error] 1240#0: *25 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "localhost"
16023 次点击
所在节点    Python
21 条回复
zhang330700
2015-11-29 12:30:04 +08:00
我遇到同样问题,在 uwsgi.yml 文件中加了一个 plugin 参数就搞定了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/53532

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX