Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help request: 400 Bad Request Request Header Or Cookie Too Large #12001

Open
lihaishi opened this issue Feb 27, 2025 · 4 comments
Open

help request: 400 Bad Request Request Header Or Cookie Too Large #12001

lihaishi opened this issue Feb 27, 2025 · 4 comments
Labels
question label for questions asked by users

Comments

@lihaishi
Copy link

Description

When I requested, it prompted that the cookie was too long. What is the reason for the session callback after logging in, and what is the encryption method? After entering my account password, it prompted me with this error message.

Image

Environment

  • APISIX version (run apisix version):3.0.0
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@dosubot dosubot bot added the question label for questions asked by users label Feb 27, 2025
@mikyll
Copy link
Contributor

mikyll commented Feb 27, 2025

Hi @lihaishi 🙂

I've found some similar issue: search results

Have you tried setting "pass_host": "node" in Upstream configuration?

If that doesn't work, please provide enough details (or a Minimal Reproducible Example) to investigate further: it's difficult to infer what could be the cause, without knowing how you deploy APISIX and/or how you configure the routes 😄

@lihaishi
Copy link
Author

你好@lihaishi🙂

我发现了一些类似的问题:搜索结果

您是否尝试过"pass_host": "node"在“上游”配置中进行设置?

如果这不起作用,请提供足够的细节(或最小可重现示例)以进一步调查:如果不知道如何部署 APISIX和/或**如何配置路由,**就很难推断出可能的原因😄

Is it because the identity authentication service returned too many fields? May I ask what content this session is based on, or what information do you need me to provide to help me locate the problem more quickly

@mikyll
Copy link
Contributor

mikyll commented Feb 27, 2025

@lihaishi

I think the problem is not related to APISIX, but rather to OpenResty/NGiNX default configuration: since there's no direct reference, in APISIX source code, to that "Request Header Or Cookie Too Large", I'm inclined to believe it's due to something else. Upon searching, I've found the following references:

To solve this you can try increasing the large_client_header_buffers (which by default is set to 8k), for example to 32k.

You can do that by editing your APISIX configuration file (located at $(apisix_src)/conf/config.yaml), and setting the following:

nginx_config:
  http_configuration_snippet: |
    large_client_header_buffers 4 32k;

You can have a look at this example config file.

Let me know if that solved the issue 🙂

@lihaishi
Copy link
Author

@lihaishi

我认为问题与 APISIX 无关,而是与 OpenResty/NGiNX 默认配置有关:由于 APISIX 源代码中没有直接提及“请求标头或 Cookie 太大”,因此我倾向于认为这是由其他原因引起的。经过搜索,我找到了以下参考资料:

为了解决这个问题,您可以尝试增加large_client_header_buffers(默认设置为 8k),例如增加到 32k。

您可以通过编辑 APISIX 配置文件(位于$(apisix_src)/conf/config.yaml)并设置以下内容来实现此目的:

nginx_config:
http_configuration_snippet: |
large_client_header_buffers 4 32k;
您可以看看这个示例配置文件

如果问题解决了请告诉我 🙂

I tried configuring your information and increased the parameters appropriately. Now it doesn't report 400 anymore. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question label for questions asked by users
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants