tarampampam / error-pages

🚧 Pretty server's error pages in the docker image & git repository (for traefik, k8s, nginx and so on)
https://tarampampam.github.io/error-pages/
MIT License
833 stars 81 forks source link

"Too big request header" #238

Closed Quasarman closed 9 months ago

Quasarman commented 11 months ago

Is there an existing issue for this?

Describe the bug

When the auth cookies for my website are present and I try to a non existing page I get "Too big request header" instead of the error page. When I clear said cookies I see my error page as expected.

Steps to reproduce

  1. Setup error pages
  2. Set long token in cookies
  3. Get "Too big request header" instead of error page

Configuration files

No response

Relevant log output

No response

Anything else?

I am not sure if this is a traefik issue, It does only happen with the error page container, accessing the normal webpage is fine with and without the auth cookies set.

tarampampam commented 11 months ago

Could you please provide an example (e.g., a curl command) to reproduce the error?

Quasarman commented 11 months ago

I think this is related: https://github.com/traefik/traefik/issues/8846

Maybe we can configure thr max header bytes for the error pages server aswell? Via a env variable or so.

I dont really have an example on hand since i dont want to provide my auth cookies (for obvious reasons).

alphanoob1337 commented 9 months ago

I forked the project and introduced a new environment variable READ_BUFFER_SIZE which can be used to pass the desired maximum request size in bytes (including header and body). See pull request #244.

Quasarman commented 9 months ago

Very nice thank you! 😀

tarampampam commented 9 months ago

🚀 v2.26.0

keitetran commented 8 months ago

I have this error with traefik.

Too big request header

My env

READ_BUFFER_SIZE: 1024

How to fix it ? Thank bro.

alphanoob1337 commented 8 months ago

Just increase the number until it works. A larger read buffer has only one negative side-effect: the resource consumption is slightly higher. On an average server and normal load conditions this should not cause any problems since error-pages does not require many resources in the first place. But it might make it easier for someone with bad intentions to deliberately overload your server by sending many requests with a lot of payload data. So you also don't want to increase the read buffer to the maximum possible value.