Heim >Backend-Entwicklung >PHP-Tutorial >Nginx反向代理上传大文件报错(failed to load resource : net :: ERR_CONNECTION_RESET)

Nginx反向代理上传大文件报错(failed to load resource : net :: ERR_CONNECTION_RESET)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 09:01:518150Durchsuche

Nginx反向代理上传大文件报错(failed to load resource : net :: ERR_CONNECTION_RESET)

http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

正文

当使用Nginx反向代理上传大文件报错

<code>failed <span>to</span><span>load</span> resource : net :: ERR_CONNECTION_RESET</code>

经查是Nginx的配置问题。
使用

<code>client_max_body_size <span>size</span>;</code>

用于配置请求中Body的最大可允许值。size的单位为M,Nginx默认的设置是1m。数值按需自行设置即可。例如限制为1G:

<code>client_max_body_size 1024m;</code>

此配置可放在 http | server | location 任一处,对应不同的作用范围。

官方文档说明:

<code><span>Syntax</span>: <span>client_max_body_size size;</span><span>Default</span>: <span>client_max_body_size 1m;</span><span>Context</span>: <span>http, server, location</span></code>

  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.

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了Nginx反向代理上传大文件报错(failed to load resource : net :: ERR_CONNECTION_RESET),包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn