EKsumic's Blog

let today = new Beginning();

Click the left button to use the catalog.

OR

[Solutions to nginx server] Upload file reports 413 Request Entity Too Large error

The reason for this is because the server limits the upload size.

Solutions to nginx server

It can be solved by modifying the value of nginx.conf.
Paste the following code into nginx.conf:

client_max_body_size 20M;

You can choose to set in http{ }: client_max_body_size 20m;
You can also choose to set in server{ }: client_max_body_size 20m;
You can also choose to set in location{ }: client_max_body_size 20m.
There is a difference between the three:
Set to http{} to control the size of all request messages in global nginx;
Set to server{} to control the size of all request packets of the server;
Set to location{} to control the size of request packets that meet the routing rules.

Note: If the 413 error still occurs after the above modification, it may be a domain name problem. I have encountered such a situation.

This article was last edited at 2021-01-03 10:49:00

* *