Welcome! Log In Create A New Profile

Advanced

Re: How to do a large buffer size > 64k uWSGI requests with Nginx proxy | uwsgi request is too big with nginx

Maxim Dounin
May 27, 2021 07:54PM
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/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to do a large buffer size > 64k uWSGI requests with Nginx proxy | uwsgi request is too big with nginx

Rai Mohammed May 27, 2021 02:55PM

Re: How to do a large buffer size > 64k uWSGI requests with Nginx proxy | uwsgi request is too big with nginx

Maxim Dounin May 27, 2021 07:54PM

Re: How to do a large buffer size > 64k uWSGI requests with Nginx proxy | uwsgi request is too big with nginx

Rai Mohammed May 27, 2021 09:59PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready