Node/Nginx,413个请求实体太大,设置了client_max_body_size [英] Node/Nginx, 413 request entity too large, client_max_body_size set

查看:186
本文介绍了Node/Nginx,413个请求实体太大,设置了client_max_body_size的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

非常类似于 https://serverfault.com/questions/539466/413-request-entity-too-large-client-max-body-size-is-set

我已经在nginx(具体来说,dockerfile/nginx映像)上运行了一个节点服务器(使用回送),但是每当我对节点服务器执行大的PUT(或POST)请求时,我都会得到返回413响应.

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.

我在很多地方都设置了client_max_body_size(对我来说,在/etc/nginx/nginx.conf中),设置的值过高,但仍然得到413s ...我缺少什么吗?

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?

推荐答案

感谢Xavier Lucas,问题确实出在应用程序而不是nginx配置上,如本Github问题所示:

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

通过显式设置json和urlencoded限制来解决.

Resolved by setting json and urlencoded limits explicitly.

这篇关于Node/Nginx,413个请求实体太大,设置了client_max_body_size的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆