Node/Nginx, 413 request entity too large, client_max_body_size set
Asked Answered
B

2

1

Pretty similar to https://serverfault.com/questions/539466/413-request-entity-too-large-client-max-body-size-is-set

I've got a Node server (using Loopback) running on top of nginx (to be specific, the dockerfile/nginx image), but whenever I do a large PUT (or POST) request to the Node server, I get back a 413 response.

I've set client_max_body_size (for me, in /etc/nginx/nginx.conf) in a number of places and to exorbitant values and yet still get the 413s... is there something I'm missing?

Bendite answered 29/11, 2014 at 1:11 Comment(2)
Check what part is returning this HTTP code : nignx or your app.Polydactyl
Eek, thanks Xavier. Looks like my app may be culpable: github.com/strongloop/loopback/issues/690Bendite
B
1

Thanks to Xavier Lucas, problem was indeed with the app and not the nginx config, as suggested in this Github issue:

https://github.com/strongloop/loopback/issues/690

Resolved by setting json and urlencoded limits explicitly.

Bendite answered 30/11, 2014 at 1:45 Comment(1)
Do you remember, did the 413 response include "nginx" in the body? I'm having the same issue (uploading 2.5M to a server configured for 100G) and getting a 413 response that contains <center>nginx</center>. I'm not sure if Nginx is throwing the error, or just putting the HTML to the node app's 413 header.Ignazio
M
0

I meet the same error, my node server use the koa-bodyparser, it limit the urlencoded body:

formLimit: limit of the urlencoded body. If the body ends up being larger than this limit, a 413 error code is returned. Default is 56kb.

It is nothing to do with nginx.

Michikomichon answered 11/1, 2019 at 3:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.