错误:读取上游时,readv()失败(104:对等连接重置) [英] Error: readv() failed (104: Connection reset by peer) while reading upstream
问题描述
我有带Nginx和uwsgi的flask的facebook应用.当它从Facebook收到POST时,总是有错误:
readv() failed (104: Connection reset by peer) while reading upstream
但是当我直接使用GET方法访问我的应用程序时,它运行平稳.我所做的:
- 仅使用
POST
方法限制@ app.route-不起作用. - 在wsgi中添加限制:
uwsgi_buffer_size
(如果来自Facebook的请求很大)和uwsgi_harakiri
(如果uwsgi在完成请求之前提供超时)-不起作用.
我在 django 中有变通办法,但无法弄清楚尚未在烧瓶中实施.有人可以帮忙吗?
这是uwsgi的错误.您可以从 [uWSGI]几个错误中获取更多信息. >
简单的解决方案是,即使通过POST正文为null或不需要POST参数,也必须通过wsgi.input读取POST正文.
I have facebook apps with flask with nginx and uwsgi. When it receive POST from facebook, it always has error:
readv() failed (104: Connection reset by peer) while reading upstream
But when I access my apps directly (with GET method), it ran smoothly. What I've done:
- Limit @app.route with
POST
method only - doesn't work. - Add limit in wsgi:
uwsgi_buffer_size
(in case request from facebook is big), anduwsgi_harakiri
(in case uwsgi provide timeout before finish it request) - doesn't work.
I have workaround in django but can't figure out yet how to implement in flask. Could anyone help please?
This is the bug of uwsgi. You can get more from [uWSGI] Several bugs .
The simple solution is that you must read the POST body by wsgi.input, even through POST body is null or you don't need POST params.
这篇关于错误:读取上游时,readv()失败(104:对等连接重置)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!