gpt4 book ai didi

nginx - 如何设置 nginx 请求允许的 url 长度(错误代码 : 414, uri 太大)

转载 作者:行者123 更新时间:2023-12-03 05:56:32 33 4
gpt4 key购买 nike

我在 10 个杂种面前使用 Nginx。

当我发出大小大于 2900 的请求时,我会返回:

error code 414: uri too large

有人知道 nginx 配置文件中确定允许的 uri 长度的设置吗?

最佳答案

来自:http://nginx.org/r/large_client_header_buffers

Syntax: large_client_header_buffers number size ;
Default: large_client_header_buffers 4 8k;
Context: http, server

Sets the maximum number and size of buffers used for reading large client request header. A request line cannot exceed the size of one buffer, or the 414 (Request-URI Too Large) error is returned to the client. A request header field cannot exceed the size of one buffer as well, or the 400 (Bad Request) error is returned to the client. Buffers are allocated only on demand. By default, the buffer size is equal to 8K bytes. If after the end of request processing a connection is transitioned into the keep-alive state, these buffers are released.

因此您需要将该行末尾的大小参数更改为更大的值以满足您的需要。

关于nginx - 如何设置 nginx 请求允许的 url 长度(错误代码 : 414, uri 太大),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1067334/

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