Introduction
When a user attempts to upload a large file, you might encounter the following error message:
413 Request Entity Too Large
Procedure
You need to configure Nginx to accept larger files.
- Create a folder for the user, ensuring "USER" is replaced with the cPanel user:
mkdir -p /etc/nginx/conf.d/users/USER
- Create the file for the configuration options to reside in, replacing FILENAME with a valid file name that does not begin with "cpanel-":
nano /etc/nginx/conf.d/users/$username/FILENAME.conf
- Place the following line within the newly created file, adjusting the value according to your needs:
client_max_body_size 32M;
- Rebuild the Nginx configuration for the user, ensuring "USER" is replaced with the cPanel user:
/scripts/ea-nginx config USER
You may also need to adjust the upload limits for ModSecurity and PHP. You can view details on how to do so in the following support articles:
PHP File upload failed (Request Entity Too Large) [ModSecurity]
How to increase the maximum file upload size limit in PHP
Comments
0 comments
Article is closed for comments.