nginx报错:
10.148.76.11 - - [07/Dec/2023:14:27:47 +0800] "POST /v1/txt2img HTTP/1.1" 200 1439595 "-" "python-requests/2.31.0" "58.144.221.164"
2023/12/07 14:27:47 [error] 129#129: *730054 client intended to send too large body: 1899715 bytes, client: 10.148.76.14, server: api.test.com, request: "POST /v1/png-info HTTP/1.1", host: "api.test.com"
10.148.76.14 - - [07/Dec/2023:14:27:47 +0800] "POST /v1/png-info HTTP/1.1" 413 183 "-" "python-requests/2.31.0" "58.144.221.164"
分析:
在nginx使用过程中,上传文件的过程中,nginx报文大小限制,出现413 Request Entity Too Large。
我们需要在nginx http中设置client_max_body_size,默认值是1m。
设置完成后,使用nginx -s reload没生效,使用restart才生效。