Skip to main content

nginx上传文件出现413 Request Entity Too Large?

· One min read

需求场景

当用nginx上传文件时,出现413 Request Entity Too Large报错

解决方案

找到nginx的配置文件nginx.conf,修改或增加client_max_body_size属性值大小

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
client_max_body_size 5m;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

##以下省略
}