Nginx反向代理上傳大文件報錯

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

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

正文

當使用Nginx反向代理上傳大文件報錯nginx

failed to load resource : net :: ERR_CONNECTION_RESET

經查是Nginx的配置問題。
使用this

client_max_body_size size;

用於配置請求中Body的最大可容許值。size的單位爲M,Nginx默認的設置是1m。數值按需自行設置便可。例如限制爲1G:spa

client_max_body_size 1024m;

此配置可放在 http | server | location 任一處,對應不一樣的做用範圍。代理

官方文檔說明:code

Syntax: client_max_body_size size;
Default: client_max_body_size 1m;
Context: http, server, location

  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 sizeserver

相關文章
相關標籤/搜索