WordPress site stuck at 1MB for max file size

I had the very same problem. None of googled articles suggesting trivial solutions (like “resize image”, “wait a bit”) helped.

Symptoms: media uploading works perfectly, but only for some files (larger than 1Mb) the “HTTP error” occurs.

But when I tried to check my web server logs, everything became clear in one second. I suppose you use nginx (as I do), so:

  1. Check nginx logs: tail /var/log/nginx/error.log
  2. If you see errors like 10899 client intended to send too large body: 1198151 bytes, client: <IP address>, server: example.com, request: “POST /wp-admin/async-upload.php HTTP/1.1”, host: “example.com”, referrer: “http://example.com/wp-admin/post.php?post=<post id>&action=edit” than it’s easy – your webserver is blocking requests larger than 1 Mb (nginx default)
  3. So modify your nginx config sudo vi /etc/nginx/nginx.conf
  4. Insert client_max_body_size 20M; somewhere in the [http] section.
  5. Restart nginx sudo /etc/init.d/nginx restart or sudo service nginx reload
  6. Check your site and make sure it works (or at least there are no more nginx errors in the log)

Reference: https://websistent.com/fix-client-intended-to-send-too-large-body-nginx-error/

Leave a Comment