自己的一个小项目,通过nginx部署,在上传文件时
出现报错:
Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
错误原因:
由于Nginx中的client_max_body_size默认值为1MB,当上传文件大于1MB时,就会出现这个错误。
解决方法:
打开Nginx反向代理服务器nginx.conf配置文件,修改client_max_body_size值 client_max_body_size 1024M
[root@localhost nginx]# tail nginx.conf
# location / {
# root html;
# index index.html index.htm;
# }
#}
client_max_body_size 1024m;
}
重启nginx即可。