1. 程式人生 > >Nginx反向代理上傳大檔案報錯(failed to load resource : net :: ERR_CONNECTION_RESET)

Nginx反向代理上傳大檔案報錯(failed to load resource : net :: ERR_CONNECTION_RESET)

轉自:

https://blog.csdn.net/kinginblue/article/details/50753271?locationNum=14&fps=1

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反向代理上傳大檔案報錯

failed to load resource : net :: ERR_CONNECTION_RESET
1
經查是Nginx的配置問題。
使用

client_max_body_size size;
1
用於配置請求中Body的最大可允許值。size的單位為M,Nginx預設的設定是1m。數值按需自行設定即可。例如限制為1G:

client_max_body_size 1024m;
1
此配置可放在 http | server | location 任一處,對應不同的作用範圍。


官方文件說明:

Syntax: client_max_body_size size;
Default: client_max_body_size 1m;
Context: http, server, location
1
2
3
  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.
---------------------
作者:kinginblue
來源:CSDN
原文:https://blog.csdn.net/kinginblue/article/details/50753271
版權宣告:本文為博主原創文章,轉載請附上博文連結!