How to do a large buffer size > 64k uWSGI requests with Nginx proxy | uwsgi request is too big with nginx
Maxim Dounin
mdounin at mdounin.ru
Thu May 27 23:53:53 UTC 2021
Hello!
On Thu, May 27, 2021 at 02:55:24PM -0400, Rai Mohammed wrote:
> How to do a large buffer size > 64k uWSGI requests with Nginx proxy
>
> Deployment stack :
> Odoo ERP 12
> Python 3.7.10 and Werkzeug 0.16.1 as backend
> Nginx proxy : 1.20.0
> uWSGI : 2.0.19.1
> OS : FreeBSD 13.0-RELEASE
>
> Nginx throw an alert from uwsgi of request is too big
> Alert : uwsgi request is too big: 81492, client: 10.29.79.250, server:
> odoo12ce-erp, request: "GET /web/webclient/..........."
>
> As you can see I increased the "uwsgi_buffer_size " in both uwsgi.ini and
> nginx.conf.
The uwsgi protocol uses 16-bit datasize field[1], and this limits
maximum size of all headers in a request to uwsgi backends. The
error message from nginx suggests you are hitting this limit.
Unfortunately, using larger buffers won't help here.
In most cases such a huge request headers indicate that there is a
bug somewhere. For example, nginx by default limits total size of
request headers to 32k (see [2]). Similar 64k limit also exists
in FastCGI (though with protocol clearly defining how to provide
additional data if needed, just not implemented in nginx), and the
only case when it was questioned was due to a miscoded client (see
[3]).
If nevertheless such a huge request headers are intentional, the
most simple solution probably would be to switch to a different
protocol, such as HTTP.
[1] https://uwsgi-docs.readthedocs.io/en/latest/Protocol.html
[2] http://nginx.org/r/large_client_header_buffers
[3] https://trac.nginx.org/nginx/ticket/239
--
Maxim Dounin
http://mdounin.ru/
More information about the nginx
mailing list