Fix [HTTP Error] client intended to send too large body [Media Upload WordPress]

"HTTP Error”Is a common error among users of WordPress using the classic upload method photos, documents, and other files.
Every time we encounter an SQL, HTTP error, it's a good idea to check the logs on the server. They can give us more information about the error message displayed in the browser.

Here is an example of an “HTTP error”In the browser when trying to upload a .PDF file:

The same error in server logs looks altogether different. Much more detailed and easy to move the solution to the problem. Depending on the configuration of the web server and HTTP / HTTPS services, the file containing error data can be of the following form: error.log, error_log, domain-name.error.log, etc.

2019/06/10 12:58:14 [error] 25084#25084: *22825511 client intended to send too large body: 1143385 bytes, client: 84.XX.XX.XX, server: stealthsettings.com, request: "POST /wp-admin/async-upload.php HTTP/1.1", host: "stealthsettings.com", referrer: "https://stealthsettings.com/wp-admin/post.php?post=19644&action=edit"

The above error tells us that the file we want to climb on the server is higher than the allowed server limit per upload session. This limit is routed to the general configuration file NGINX (nginx.conf) or in the custom NGINX config file of the domain that we encountered.
“HTTP error"Appears most often when we have a file with large MB volume or we do upload simultaneously to multiple files.

How to resolve the error "client intended to send too large body - HTTP error"

The easiest way is to edit the file "nginx.conf”And establish a directive to change the upload limit allowed per session. In our case we set the limit of 10 MB per body of upload files.

client_max_body_size 10M;

The above directive will be added to the http (server / location) section.

We save the "nginx.conf" file edited with "vi" or "nano", then test the nginx configuration.

nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

RestartI have the nginx service:

service nginx restart

or

systemctl restart nginx

After these steps, resume the upload process. Everything should go smoothly and the error "HTTP error" to disappear.

Many WordPress users with blogs / hosted sites on NGINX servers face this limitation lately. Most likely, this limitation comes with the new security features introduced in the latest version of NGINX.

Leave a Reply

your email address will not be published. Required fields are marked *

Total
0
Shares
Previous Article

How to fix BSOD (BLUE SCREEN) DRIVER_IRQL_NOT_LESS_OR_EQUAL error on Windows 10

Next Article

macOS Catalina - Security plus with dedicated read-only volume (macOS Date)

Total
0
Share