Today in the test colleague in testing the new machine OCR recognition when prompted to upload pictures failed to view Nginx log found the following error:
The reason is because the client upload file size exceeds the Nginx limit (default is 1M) The official explanation is as follows:
Http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
Syntax: client_max_body_size size;Default: client_max_body_size 1m;Context: http, server, location
The workaround is to add the following configuration (HTTP context in nginx.conf) to the Nginx configuration file:
http { ...client_max_body_size 8M; client_body_buffer_size 128k; ... }
After the completion of the smooth restart Nginx can
After the completion of the smooth restart Nginx can:
nginx -t
Ps:http 413 Status Code
The server refuses to process the current request because the size of the entity data submitted by the request exceeds the scope that the server is willing or able to handle. In this case, the server can close the connection to prevent the client from continuing to send this request. If this condition is temporary, the server should return a retry-after response header to tell the client how much time it can retry.
Nginx Upload file 413 error resolution (Request Entity Too Large)