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

Nginx returns "Bad Request - Error parsing headers" for headers larger than 8k #9437

Closed
2 tasks done
roboptics opened this issue Jun 19, 2023 · 3 comments
Closed
2 tasks done
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@roboptics
Copy link

Describe the issue

If a request is sent with a header larger than 8k, the error "400 error - Request Header Or Cookie Too Large" is shown by nginx. This is a common situation for the cookies header when weblate is hosted under the same domain as other applications.
This can be fixed by setting:

large_client_header_buffers 8 32k;

in nginx configuration, for instance in /etc/nginx/sites-enabled/weblate.

After adding the setting aboce to the nginx configuration, the error on the title in shown "Bad Request - Error parsing headers: 'limit request headers fields size'".
I tried to set additional settings to nginx, but nothing works. Probably this is beeing thrown by some other component.
Did not find any information on the documentation or posted on how to increase the maximum header size for weblate.

Any help is appreciated.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Add a header to the domain where weblate is hosted that is larger than 8k.
  2. Try to access weblate

Expected behavior

The errors in the description are shown

Screenshots

image

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Jun 27, 2023

How do you run Weblate?

weblate.org service

Most likely not as you are changing the nginx configuration.

The error message is coming from gunicorn (https://github.com/benoitc/gunicorn/blob/add8a4c951f02a67ca1f81264e5c107fa68e6496/gunicorn/http/message.py#L103), adjust its configuration.

@nijel nijel added the question This is more a question for the support than an issue. label Jun 27, 2023
@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@github-actions
Copy link

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

@github-actions github-actions bot added the wontfix Nobody will work on this. label Jul 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants