gpt4 book ai didi

post - 错误 : readv() failed (104: Connection reset by peer) while reading upstream

转载 作者:行者123 更新时间:2023-12-03 15:31:29 26 4
gpt4 key购买 nike

我有带有 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 中有解决方法但还不知道如何在 flask 中实现。有人可以帮忙吗?

    最佳答案

    这是uwsgi的bug。您可以从 [uWSGI] Several bugs 获得更多信息.

    简单的解决方案是您必须通过 wsgi.input 读取 POST body,即使 POST body 为 null 或者您不需要 POST 参数。

    关于post - 错误 : readv() failed (104: Connection reset by peer) while reading upstream,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10393203/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com