<p>正文</p><p>当使用Nginx反向代理上传大文件报错</p><p>failed to load resource : net :: ERR_CONNECTION_RESET</p><p>经查是Nginx的配置问题。</p><p>使用</p><p>client_max_body_size size;</p><p>用于配置请求中Body的最大可允许值。size的单位为M,Nginx默认的设置是1m。数值按需自行设置即可。例如限制为1G:</p><p>client_max_body_size 1024m;</p><p>此配置可放在 http | server | location 任一处,对应不同的作用范围。</p><p>附</p><p>官方文档说明:</p><p>Syntax: client_max_body_size size;</p><p>Default: client_max_body_size 1m;</p><p>Context: http, server, location</p><p> Sets the maximum allowed size of the client request body, specified in the "Content-Length" request header field. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client. Please be aware that browsers cannot correctly display this error. Setting size to 0 disables checking of client request body size.</p>