Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)


Node应用,使用formidable处理文件上传,本地测试没有问题,部署到服务器上之后上传大文件浏览器收到以下错误信息:

Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)

原因是服务器使用Nginx做代理而限制了上传文件的大小,修改Nginx配置:

 location / {
                        client_max_body_size  100M;
                        proxy_pass http://node_app;
}

在location 下面增加client_max_body_size 100M;配置项,重启Nginx文件上传成功.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM