# Tweak suggestion

**URL:** <https://forum.gl-inet.com/t/tweak-suggestion/25151>\
**Category:** Router\
**Created:** [November 15, 2022, 4:00am UTC](https://forum.gl-inet.com/t/tweak-suggestion/25151 "2022-11-15T04:00:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![y2kbug](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/y2kbug/32/8491_2.png) [@y2kbug](https://forum.gl-inet.com/u/y2kbug)\
**Post date:** [November 15, 2022, 4:00am UTC](https://forum.gl-inet.com/t/tweak-suggestion/25151/1 "2022-11-15T04:00:13Z")

</div>

I have been applying Cloudflare Access to my infrastructure.  
When accessing GL routers, NGINX on router shows HTTP 400 “Request Header Or Cookie Too Large”.  
Google-ed it says: [https://community.cloudflare.com/t/after-succesful-login-with-access-control-400-error-request-header-or-cookie-too-large/268176](https://community.cloudflare.com/t/after-succesful-login-with-access-control-400-error-request-header-or-cookie-too-large/268176)

May I suggest to tweak the NGINX configuration for that?

Thanks.

---

<div class="post-metadata">

**Author:** ![yuxin.zou](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/yuxin.zou/32/11475_2.png) [@yuxin.zou](https://forum.gl-inet.com/u/yuxin.zou)\
**Post date:** [November 15, 2022, 6:40am UTC](https://forum.gl-inet.com/t/tweak-suggestion/25151/2 "2022-11-15T06:40:38Z")

</div>

Can you check how big cookies Cloudflare Access is using? Would clearing the browser cookie before accessing or using the InPrivate window solve this problem?

> [@y2kbug](#):
>
> Google-ed it says: [https://community.cloudflare.com/t/after-succesful-login-with-access-control-400-error-request-header-or-cookie-too-large/268176](https://community.cloudflare.com/t/after-succesful-login-with-access-control-400-error-request-header-or-cookie-too-large/268176)

Did you add the `client_header_buffer_size` parameter to the nginx profile as described in the topic? Does it work?

If it passes an invalid and large cookies, nginx may take a lot of time to process it. This can cause your access to be slowed down.

---

<div class="post-metadata">

**Author:** ![y2kbug](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/y2kbug/32/8491_2.png) [@y2kbug](https://forum.gl-inet.com/u/y2kbug)\
**Post date:** [November 15, 2022, 7:12am UTC](https://forum.gl-inet.com/t/tweak-suggestion/25151/3 "2022-11-15T07:12:52Z")

</div>

Just tested on incognito mode.  
I am sorry but the problem seems to be not exactly on max-cookie-size.  
There is a redirection loop.  
May I ask if the built-in Nginx handles HTTP to HTTPS redirection, if URL (instead of IP) is used?  
Could I “tail” the access log anywhere?

---

<div class="post-metadata">

**Author:** ![yuxin.zou](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/yuxin.zou/32/11475_2.png) [@yuxin.zou](https://forum.gl-inet.com/u/yuxin.zou)\
**Post date:** [November 15, 2022, 7:28am UTC](https://forum.gl-inet.com/t/tweak-suggestion/25151/4 "2022-11-15T07:28:50Z")

</div>

nginx does not have no redirects. http uses port 80, https uses port 443. Are you accessing port 443?  
The Log page contains nginx logs now.

---

<div class="post-metadata">

**Author:** ![y2kbug](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/y2kbug/32/8491_2.png) [@y2kbug](https://forum.gl-inet.com/u/y2kbug)\
**Post date:** [November 15, 2022, 8:10am UTC](https://forum.gl-inet.com/t/tweak-suggestion/25151/5 "2022-11-15T08:10:14Z")

</div>

I have changed `/etc/nginx/nginx.conf` from the default

```auto
client_header_buffer_size 1k;

```

to

```auto
client_header_buffer_size 4k;

```

and it works now.

[https://community.cloudflare.com/t/400-bad-request-request-header-or-cookie-too-large-nginx/285870](https://community.cloudflare.com/t/400-bad-request-request-header-or-cookie-too-large-nginx/285870)

Thanks.

---

<div class="post-metadata">

**Author:** ![bruce](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bruce/32/35649_2.png) [@bruce](https://forum.gl-inet.com/u/bruce)\
**Post date:** [October 29, 2025, 4:19am UTC](https://forum.gl-inet.com/t/tweak-suggestion/25151/6 "2025-10-29T04:19:33Z")

</div>


