Client intended to send too large body: 14601004 bytes, client: xx.xx.xx.xx, server: cronitor.link. 14 MB is a big POST. Occasionally a customer will push a bug into production that tries to DOS us in some way. Their traffic gets blocked at the firewall while we reach out. More than 3 years have passed since last update. Nginx が稼働しているWebページで、フォームからファイルをアップロードしようとしたら、 '1 client intended to send too large body: 1367171 bytes' というエラーが発生しました。 これは、nginx が POST.
Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHave 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
Comments
commented Dec 29, 2016
i.e. no upload limit |
self-assigned this Dec 29, 2016
referenced this issue Dec 29, 2016
ClosedChange default upload limit to unlimited #100
commented Dec 30, 2016
What motivates this configuration change? The reason nginx defaults it so low is to remove possible DoS vectors iiuc, so I'd expect changing this default to require a bit more justification. |
commented Dec 30, 2016 • edited
edited
Good point. In the last week I helped at least 5 user with upload issues with the ingress controller (slack) This is the list of issues I see with the current default:
I am not sure if this list justifies the change (most are just UX 'issues') but the first impression of the users is not good. |
commented Dec 30, 2016
The default's only too low if you want to accept uploads, which certainly isn't everyone.
The log lines should be quite different. 2016/12/30 1:11:11 [error] ... client intended to send too large body: ... vs ... upstream.name [...] 413 One of them, nginx reports an error itself, the other, nginx just reports a statuscode that it's proxying. If you do want to accept uploads, the right solution isn't to set the size to '0', but to some reasonable value for the expected content (e.g. image upload sites might pick 20M, file hosting sites might pick 100M). I don't think 0 is ever the correct value. I think we should improve the UX, and possibly increase the default by a small margin as a reasonable compromise perhaps. |
commented Jan 1, 2017
I'd like to see the ability to change the value per host/ingress. |
commented Jan 2, 2017
I think having this value configured using annotations on the ingress object might be a better solution. As you might need higher value for some services whereas for others you would prefer default 1m. |
commented Jan 7, 2017
@aledbf the PR #100 make the default unlimited for all ingress, I still think we need a mechanism in general to override default settings for ingress object using annotation on object. Settings such as max body size, session stickiness etc. does require overriding in certain cases from default. Any plan on supporting that. |
referenced this issue Jan 20, 2017
MergedAdd annotation to allow custom body sizes #148
commented Jan 21, 2017
@gurvindersingh#148 allows custom body sizes using annotations |
commented Jan 21, 2017
Leaving current default of '1m'. |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
I am using django-resto to upload my media files to remote server. However when I tried to upload, it gives me
django_resto.storage: Failed on create
.And Log generated below messages,
Can someone please explain why I am getting such an error?
Settings for Media Server,
Nginx configuration,
Ahsan
AhsanAhsan
1 Answer
This issue will be caused by nginxs low default
client_max_body_size
value (1MB).You will need to set the
client_max_body_size <value>
to something higher in one of the following context blocks:- http
- location
- server
The code will be something like this:
Personally I would put the
client_max_body_size
on a location
block. This means that your new max body size will not be globally set and instead set for a particular sub location of your website.note: Remember you will need to reload your config file before changes take affect.
also note: You only make the
client_max_body_size
the value you need plus a little bit. Stops people potentially sending up massively huge files in an attempt to cripple your server. Matt SeymourMatt Seymour