Request Header Or Cookie Too Large


#1

I’m getting the following error when my site’s page makes an ajax request:

400 Bad Request
Request Header Or Cookie Too Large
cloudflare

When I look at the logs on my server I can see that this request stops at Cloudflare and does not come through to my server.

I think that the problem is because the referer (sic) in the Header is massive and there’s nothing I can do about that because the browser inserts this and does not allow the developer to override this value. Any ideas on how I can solve this problem?

Kudos to Cloudflare for saying that it’s the Request Header/Cookie that’s the problem and not just returning a 400. If Cloudflare staff/developers are reading this it would also be incredibly useful if a breakdown (list) of headers/cookies and their sizes were provided to assist the developer in understanding the problem better.


#2

This is probably something they’d like to hear about. You can email them at: support AT cloudflare DOT com


#3

I sent that email - thanks for the suggestion.

Is there anyway that I could use a rule for that page to bypass Cloudflare? I’m looking at the rules right now and I can’t see one that would work for this scenario. When I test this against my server it works okay and doesn’t have a problem with header/cookie size.

I’m taking a wild guess that the Nginx config that Cloudflare is using is more restrictive for headers/cookies than the one that I’m using which is why this is happening.


#4

No, you can’t circumvent the Cloudflare proxy server with a Page Rule.

I’d like to hear if there’s a solution to this.


#5

This topic was automatically closed after 14 days. New replies are no longer allowed.