mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
The default value in uwsgi is 4k; receiving more than this amount from nginx leads to a 502 response (though, happily, the backend uwsgi does not terminate).ab18dbfde5originally increased it from the unstated uwsgi default of 4096, to 8192;b1da797955made it configurable, in order to allow requests from clients with many cookies, without causing 502's[1]. nginx defaults to a limitation of 1k, with 4 additional 8k header lines allowed[2]; any request larger than that returns a response of `400 Request Header Or Cookie Too Large`. The largest header size theoretically possible from nginx, by default, is thus 33k, though that would require packing four separate headers to exactly 8k each. Remove the gap between nginx's limit and uwsgi's, which could trigger 502s, by removing the uwsgi configurability, and setting a 64k size in uwsgi (the max allowable), which is larger than nginx's default limit. uWSGI's documentation of `buffer-size` ([3], [4]) also notes that "It is a security measure too, so adapt to your app needs instead of maxing it out." Python has no security issues with buffers of 64k, and there is no appreciable memory footprint difference to having a larger buffer available in uwsgi. [1]: https://chat.zulip.org/#narrow/stream/31-production-help/topic/works.20in.20Edge.20not.20Chrome/near/719523 [2]: https://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_buffer_size [3]: https://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html [4]: https://uwsgi-docs.readthedocs.io/en/latest/Options.html#buffer-size
Zulip Markdown documentation hosted elsewhere
The Markdown files in this directory ( /zulip/docs ) are not intended to be read on GitHub. Instead, visit our ReadTheDocs to read the Zulip documentation.