Web Development

/ 0评 / 0/ 最后更新:2020-10-30
nginx上传文件出现413 Request Entity Too Large?

需求场景

当用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;

       ##以下省略
}
0

Leave a Reply

Your email address will not be published. Required fields are marked *