Introduction
When a user attempts to upload a file that is large you might encounter the following error message
"413 Request Entity Too Large"
Procedure
The fix can be found below:
To add a configuration entry to an entire user's NGINX configuration, first create a folder for the user, ensuring "$username" is replaced with the cPanel user:
mkdir -p /etc/nginx/conf.d/users/$username
Then, create the file for the configuration options to reside, replacing $filename with a valid file name that does not begin with "cpanel-"
nano /etc/nginx/conf.d/users/$username/$filename.conf
With the following information
client_max_body_size 32M;
Adjust the value according to your needs and then rebuild the Nginx configuration for the user
/scripts/ea-nginx config user
For more information about the ea-nginx script, please refer to the following documentation link.
https://docs.cpanel.net/knowledge-base/web-services/the-ea-nginx-script/
Once applied, this will allow Nginx to accept files up to the size defined.
You will also need to change the PHP Configuration for the user to allow larger file sizes as well, below is an article on how to do this.
PHP File upload failed (Request Entity Too Large)
And for more information on how to configure and adjust Nginx, please refer to the documentation below.
https://docs.cpanel.net/knowledge-base/web-services/nginx-with-reverse-proxy/