Nginx、Gunicorn、Flask_restful:Content-Length 分隔的消息正文过早结束

问题描述 投票:0回答:0

我正在使用 Nginx 和 Gunicorn 构建 Flask_restful API。尝试检索大型 json 响应时,我在使用 Java 的应用程序中收到以下错误:

org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: XXX,XXX; received: 65,378)

我假设应用程序某处内存不足,但我无法在 Gunicorn 或 Nginx 中找到响应主体大小的内存设置。我找到了与请求正文相关的设置,但这不是。

如何设置

Nginx > Gunicorn > Flask
以便能够为大型 JSON 对象提供服务?

分页响应并不是一个真正的选择。

nginx gunicorn flask-restful
© www.soinside.com 2019 - 2024. All rights reserved.