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

@mikyll
Hello, I tried to configure the config file you provided, but it doesn't seem to work. Here is my configuration information
kind: ConfigMap
apiVersion: v1
metadata:
name: apisix
namespace: gv-public
data:
config.yaml: >-
nginx_config:
http_configuration_snippet: |
large_client_header_buffers 4 32k;
apisix:
node_listen: 9080 # APISIX listening port
enable_ipv6: false
enable_control: true
control:
ip: "0.0.0.0"
port: 9092
deployment:
admin:
allow_admin: # https://nginx.org/en/docs/http/ngx_http_access_module.html#allow
- 0.0.0.0/0 # We need to restrict ip access rules for security. 0.0.0.0/0 is for test.

    admin_key:
      - name: "admin"
        key: edd1c9f034335f136f87ad84b625c8f1
        role: admin                 # admin: manage all configuration data

      - name: "viewer"
        key: 4054f7cf07e344346cd3f287985e76a2
        role: viewer

  etcd:
    host:                           # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
      - "http://apisix-etcd.gv-public.svc.cluster.local:2379"
    prefix: "/apisix"               # apisix configurations prefix
    timeout: 30                     # 30 seconds

plugin_attr:
  prometheus:
    export_addr:
      ip: "0.0.0.0"
      port: 9091

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