You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "lihaishi (via GitHub)" <gi...@apache.org> on 2025/02/27 06:51:56 UTC
[I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
lihaishi opened a new issue, #12001:
URL: https://github.com/apache/apisix/issues/12001
### 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.

### 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`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "mikyll (via GitHub)" <gi...@apache.org>.
mikyll commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2687401912
@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:
- [StackOverflow thread](https://stackoverflow.com/questions/17524396/400-bad-request-request-header-or-cookie-too-large)
- [NGiNX Docs | ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers)
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:
```yaml
nginx_config:
http_configuration_snippet: |
large_client_header_buffers 4 32k;
```
You can have a look at this [example config file](https://github.com/apache/apisix/blob/4c7918fe6fe469c8e3b749cb520936fc1b5bc4ba/conf/config.yaml.example#L190).
Let me know if that solved the issue 🙂
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "lihaishi (via GitHub)" <gi...@apache.org>.
lihaishi commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2687354948
> 你好[@lihaishi](https://github.com/lihaishi)🙂
>
> 我发现了一些类似的问题:[搜索结果](https://github.com/search?q=repo%3Aapache%2Fapisix+%22request+header+or+cookie+too+large%22)
>
> 您是否尝试过`"pass_host": "node"`在“上游”配置中进行设置?
>
> 如果这不起作用,请提供足够的细节(或[**最小可重现示例**](https://en.wikipedia.org/wiki/Minimal_reproducible_example)**)以进一步调查:如果不知道如何部署 APISIX**和/或**如何配置路由,**就很难推断出可能的原因😄
设置了

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "lihaishi (via GitHub)" <gi...@apache.org>.
lihaishi commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2689521076
> [@lihaishi](https://github.com/lihaishi)
>
> 我认为问题与 APISIX 无关,而是与 OpenResty/NGiNX 默认配置有关:由于 APISIX 源代码中没有直接提及“请求标头或 Cookie 太大”,因此我倾向于认为这是由其他原因引起的。经过搜索,我找到了以下参考资料:
>
> * [StackOverflow 线程](https://stackoverflow.com/questions/17524396/400-bad-request-request-header-or-cookie-too-large)
> * [NGiNX 文档 | ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers)
>
> 为了解决这个问题,您可以尝试增加`large_client_header_buffers`(默认设置为 8k),例如增加到 32k。
>
> 您可以通过编辑 APISIX 配置文件(位于`$(apisix_src)/conf/config.yaml`)并设置以下内容来实现此目的:
>
> nginx_config:
> http_configuration_snippet: |
> large_client_header_buffers 4 32k;
> 您可以看看这个[示例配置文件](https://github.com/apache/apisix/blob/4c7918fe6fe469c8e3b749cb520936fc1b5bc4ba/conf/config.yaml.example#L190)。
>
> 如果问题解决了请告诉我 🙂
I tried configuring your information and increased the parameters appropriately. Now it doesn't report 400 anymore. Thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "lihaishi (via GitHub)" <gi...@apache.org>.
lihaishi commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2687360580
> 你好[@lihaishi](https://github.com/lihaishi)🙂
>
> 我发现了一些类似的问题:[搜索结果](https://github.com/search?q=repo%3Aapache%2Fapisix+%22request+header+or+cookie+too+large%22)
>
> 您是否尝试过`"pass_host": "node"`在“上游”配置中进行设置?
>
> 如果这不起作用,请提供足够的细节(或[**最小可重现示例**](https://en.wikipedia.org/wiki/Minimal_reproducible_example)**)以进一步调查:如果不知道如何部署 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "mikyll (via GitHub)" <gi...@apache.org>.
mikyll commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2687351126
Hi @lihaishi 🙂
I've found some similar issue: [search results](https://github.com/search?q=repo%3Aapache%2Fapisix+%22request+header+or+cookie+too+large%22)
Have you tried setting `"pass_host": "node"` in Upstream configuration?
If that doesn't work, please provide enough details (or a [**Minimal Reproducible Example**](https://en.wikipedia.org/wiki/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** 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "lihaishi (via GitHub)" <gi...@apache.org>.
lihaishi commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2687447105
@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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "lihaishi (via GitHub)" <gi...@apache.org>.
lihaishi commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2689520233
> [@lihaishi](https://github.com/lihaishi)
>
> 我认为问题与 APISIX 无关,而是与 OpenResty/NGiNX 默认配置有关:由于 APISIX 源代码中没有直接提及“请求标头或 Cookie 太大”,因此我倾向于认为这是由其他原因引起的。经过搜索,我找到了以下参考资料:
>
> * [StackOverflow 线程](https://stackoverflow.com/questions/17524396/400-bad-request-request-header-or-cookie-too-large)
> * [NGiNX 文档 | ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers)
>
> 为了解决这个问题,您可以尝试增加`large_client_header_buffers`(默认设置为 8k),例如增加到 32k。
>
> 您可以通过编辑 APISIX 配置文件(位于`$(apisix_src)/conf/config.yaml`)并设置以下内容来实现此目的:
>
> nginx_config:
> http_configuration_snippet: |
> large_client_header_buffers 4 32k;
> 您可以看看这个[示例配置文件](https://github.com/apache/apisix/blob/4c7918fe6fe469c8e3b749cb520936fc1b5bc4ba/conf/config.yaml.example#L190)。
>
> 如果问题解决了请告诉我 🙂
I tried configuring your information and increased the parameters appropriately. Thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "lihaishi (via GitHub)" <gi...@apache.org>.
lihaishi commented on issue #12001:
URL: https://github.com/apache/apisix/issues/12001#issuecomment-2689475795
> [@lihaishi](https://github.com/lihaishi)
>
> 我认为问题与 APISIX 无关,而是与 OpenResty/NGiNX 默认配置有关:由于 APISIX 源代码中没有直接提及“请求标头或 Cookie 太大”,因此我倾向于认为这是由其他原因引起的。经过搜索,我找到了以下参考资料:
>
> * [StackOverflow 线程](https://stackoverflow.com/questions/17524396/400-bad-request-request-header-or-cookie-too-large)
> * [NGiNX 文档 | ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers)
>
> 为了解决这个问题,您可以尝试增加`large_client_header_buffers`(默认设置为 8k),例如增加到 32k。
>
> 您可以通过编辑 APISIX 配置文件(位于`$(apisix_src)/conf/config.yaml`)并设置以下内容来实现此目的:
>
> nginx_config:
> http_configuration_snippet: |
> large_client_header_buffers 4 32k;
> 您可以看看这个[示例配置文件](https://github.com/apache/apisix/blob/4c7918fe6fe469c8e3b749cb520936fc1b5bc4ba/conf/config.yaml.example#L190)。
>
> 如果问题解决了请告诉我 🙂
Sorry to bother you, I tried configuring config. YAML but it doesn't seem to work. Are you referring to editing the configuration file directly to modify the underlying nginx config. YAML?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: 400 Bad Request Request Header Or Cookie Too Large [apisix]
Posted by "juzhiyuan (via GitHub)" <gi...@apache.org>.
juzhiyuan closed issue #12001: help request: 400 Bad Request Request Header Or Cookie Too Large
URL: https://github.com/apache/apisix/issues/12001
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org