nginx download file upstream sent invalid chunked response while reading upstream error

Preface

The download directly from the server is normal, and then an error is reported when downloading via nginx routing
Insert picture description here

Check nginx error.log, the exception is as follows:

2021/01/11 12:39:06 [error] 62859#62859: *78173 upstream sent invalid chunked response while reading upstream,
2021/01/11 12:39:13 [error] 62859#62859: *78197 upstream sent invalid chunked response while reading upstream,
2021/01/11 12:39:18 [error] 62859#62859: *78207 upstream sent invalid chunked response while reading upstream,
2021/01/11 12:39:33 [error] 62859#62859: *78209 upstream sent invalid chunked response while reading upstream,
2021/01/11 12:39:50 [error] 62859#62859: *78211 upstream sent invalid chunked response while reading upstream,
2021/01/11 12:40:16 [error] 62859#62859: *78250 upstream sent invalid chunked response while reading upstream,

solve

The reason is that Http1.0 does not support long connections and block transmission, just change to version 1.1 ;

http1.0 is to establish a connection, send request information, receive request information, and disconnect the connection. Block delivery is not supported, so nginx reported an error.

nginx official website portal
Set the HTTP protocol version used for the proxy. By default, version 1.0 is used. Recommend version 1.1

句法:	proxy_http_version 1.0 | 1.1;
默认:	proxy_http_version 1.0;
内容:	http,server,location
该指令出现在版本1.1.4中。

Set as:

proxy_http_version 1.1;

Can

Guess you like

Origin blog.csdn.net/abu935009066/article/details/112465506
Recommended