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