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

400 Request Header Or Cookie Too Large #9834

Closed
francoeder opened this issue Jul 14, 2023 · 6 comments
Closed

400 Request Header Or Cookie Too Large #9834

francoeder opened this issue Jul 14, 2023 · 6 comments

Comments

@francoeder
Copy link

francoeder commented Jul 14, 2023

Description

I'm in my first steps with Apache APISIX.
I just followed the step by step contained in this page apisix-workshop, promoted by Bobur Umurzokov.

What did I do:

  • I ran the containers using the docker-compose command (following what the tutorial guides)
  • I created a route to an api that I already have published
  • I created an upstream
  • I edited the created route to consider the created upstream

However, when invoking a GET request for the mapped route, I get the error "400 Request Header Or Cookie Too Large".
curl -i -X GET "http://127.0.0.1:9080/api/v1/conteudos"

Can anyone help me?

Environment

  • APISIX version (run apisix version): 2.13.1
  • Operating system (run uname -a): Windows
  • OpenResty / Nginx version (run openresty -V or nginx -V): ???
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info): 3.4.15
  • APISIX Dashboard version, if relevant: 2.10.1
  • Plugin runner version, for issues related to plugin runners: -
  • LuaRocks version, for installation issues (run luarocks --version): -
@Revolyssup
Copy link
Contributor

Revolyssup commented Jul 14, 2023

@francoeder Can you paste the exact route and upstream configuration that you have configured? Also share the logs from access.log and error.log, if any.

@francoeder
Copy link
Author

francoeder commented Jul 14, 2023

The requested information is below.

Route configuration

{
  "uri": "/api/v1/conteudos",
  "name": "api-conteudos-dev",
  "methods": [
    "GET",
    "POST",
    "PUT",
    "DELETE",
    "PATCH",
    "HEAD",
    "OPTIONS",
    "CONNECT",
    "TRACE"
  ],
  "plugins": {
    "redirect": {
      "http_to_https": true
    }
  },
  "upstream_id": "469405594722239177",
  "status": 1
}

Upstream configuration

{
  "nodes": {
    "nest-apiconteudosdev.onrender.com": 1
  },
  "timeout": {
    "connect": 10,
    "send": 10,
    "read": 10
  },
  "type": "roundrobin",
  "scheme": "http",
  "pass_host": "pass",
  "name": "api-conteudos-dev",
  "keepalive_pool": {
    "idle_timeout": 60,
    "requests": 1000,
    "size": 320
  }
}

Note: The access.log and error.log files show nothing different after executing the offending request (curl -i -X GET "http://127.0.0.1:9080/api/v1/conteudos").

Thanks in advance for the help!

@francoeder
Copy link
Author

francoeder commented Jul 16, 2023

I managed to solve the problem.

This thread helped me 👉 #6296

I needed to configure a proxy-rewrite plugin in my route, considering the domain of my API (Same domain used in the upstream) and Voilà! I was able to consume my API via APISIX Api Gateway.

I hope it helps someone in the future.

@Revolyssup
Copy link
Contributor

@francoeder You can close this issue. Thanks

@sevensolutions
Copy link
Contributor

Because APISIX uses nginx under the hood, i solved it by adding this to my config.yml

nginx_config:
  http_server_configuration_snippet: |
    large_client_header_buffers 4 32k;

@rahulracker7539
Copy link

Because APISIX uses nginx under the hood, i solved it by adding this to my config.yml

nginx_config:
  http_server_configuration_snippet: |
    large_client_header_buffers 4 32k;

am still getting 400 Request Header Or Cookie Too Large even after putting above changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants