A 413 Request Entity Too Large error means Nginx rejected the request because the data being sent exceeded the configured size limit. The server received the request, checked its size, decided it was too large, and refused to process it.
This error almost always happens when uploading files – images, videos, documents, plugin zip files, theme files. It can also appear during large form submissions or API requests with substantial payloads.
Why Nginx has a size limit
Nginx enforces a maximum request body size to prevent clients from sending arbitrarily large amounts of data to the server. Without a limit, a single large upload could consume significant memory and bandwidth, affecting other sites on the same server.
The directive that controls this is
client_max_body_size
. The default value in Nginx is 1MB. On most hosting platforms the default is raised, but it varies by provider and plan.
When a request body exceeds this limit, Nginx returns a 413 immediately without passing the request to PHP-FPM. The upload never reaches WordPress.
PHP also has upload limits
Even if Nginx allows a large request through, PHP has its own limits that apply independently:
-
upload_max_filesize– the maximum size of a single uploaded file -
post_max_size– the maximum size of all POST data combined, including all files in a multi-file upload
Both PHP limits need to be at least as large as the files you want to upload. If Nginx allows 64MB but PHP only allows 8MB, the upload will fail with a PHP error rather than a 413.
The 413 specifically comes from Nginx. If you see a plain white page or a PHP error about file size, the limit being hit is on the PHP side.
Common situations that trigger a 413
WordPress media uploads
The WordPress media library uploader sends files as POST requests. If you are uploading a high-resolution photo, a video, a PDF, or a large image, it can easily exceed a default or low
client_max_body_size
.
Installing plugins or themes via the dashboard
WordPress lets you upload plugin and theme zip files directly through the dashboard. Some plugin zip files are large – page builders, WooCommerce extensions, and theme frameworks can exceed 20MB or more.
WooCommerce product images and downloads
WooCommerce stores often deal with large product images and digital downloads. Uploading these through the admin triggers the same upload mechanism as the media library.
REST API and custom integrations
If you have a custom integration that sends data to WordPress via the REST API or a custom endpoint, large payloads will hit the same limit. This commonly affects integrations that base64-encode images or send bulk data.
Contact form file attachments
Contact forms with file attachment fields send the attachment as part of the POST request. If a visitor attaches a large file, it hits the Nginx limit before the form plugin ever processes it.
How to fix a 413
The fix requires increasing
client_max_body_size
in Nginx and ensuring the PHP limits are set consistently. On managed hosting, you cannot edit Nginx configuration directly – your hosting provider handles this.
On managed hosting
Contact your hosting provider and specify:
- The error you are seeing (413 Request Entity Too Large)
- The size of files you need to upload
- The URL or context where the error occurs
A reasonable value for most WordPress sites is 64MB. Sites that handle video uploads or large digital downloads may need 256MB or higher. Your provider can adjust this for your account or domain.
PHP limits
On Hostney, you can adjust PHP upload limits directly from the control panel without contacting support. Go to Hosting > PHP Manager, select your website, and open the Variables tab. Find and update these two directives:
-
upload_max_filesize– set this to the maximum file size you need to upload -
post_max_size– set this to the same value or higher
post_max_size
should be equal to or larger than
upload_max_filesize
. If you allow multiple file uploads simultaneously,
post_max_size
needs to accommodate the combined size of all files. Changes apply only to the selected website and take effect immediately.
WordPress’s own upload size check
WordPress reads the PHP
upload_max_filesize
value and uses it to display the maximum upload size in the media library. If you increase the PHP limit, WordPress will reflect the new limit in the dashboard after the change takes effect.
You can verify the current limit WordPress is aware of by going to Media > Add New in the WordPress admin. The uploader shows the maximum upload file size below the drop zone.
Verifying the fix
After the limit is increased, test with a file that previously triggered the 413. If the upload completes successfully, the fix is working.
If you still get an error after the Nginx limit is increased, the remaining limit is likely on the PHP side. Check whether the error is now a PHP message rather than an Nginx 413. Adjust
upload_max_filesize
and
post_max_size
accordingly.
A note on large file uploads
Increasing the upload limit solves the 413 but does not make large uploads faster or more reliable. Very large uploads over slow connections can still time out at the PHP execution limit or the Nginx proxy timeout.
For reliable uploads of very large files (100MB+), consider:
- Uploading files via SFTP or SSH and then referencing them in WordPress using a plugin like Add From Server
- Using an external storage service (S3, Cloudflare R2) for large media files and a plugin like WP Offload Media to serve them
- Breaking large imports into smaller chunks where possible
These approaches bypass the HTTP upload mechanism entirely and are more reliable for large files regardless of server limits.
Summary
A 413 error from Nginx means the request body exceeded the
client_max_body_size
limit. On managed hosting, contact your provider to increase this limit and specify the file size you need to support. Ensure PHP’s
upload_max_filesize
and
post_max_size
are set to match. If the error persists after the Nginx limit is raised, the remaining limit is on the PHP side rather than Nginx.