当前位置: 代码迷 >> 综合 >> 【Nginx】Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
  详细解决方案

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

热度:42   发布时间:2023-09-21 00:42:51.0

一、现象

上传文件到服务器时,上传失败,且提示:Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)

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

 

二、原因

将报错信息翻译成中文:请求实体太大

打开控制台,可以看到这个文件大小为25M

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

 

三、解决方式

nginx 默认接收最大的请求实体大小为 20M,可以通过 client_max_body_size 设置修改接收请求实体的大小限制。

client_max_body_size   30m;

 

 

  相关解决方案