With Nginx Manager Enabled in WHM Cpanel you receive a 413 Error when uploading to WordPress (or other sites)
Recently WHM / Cpanel enabled an option for Nginx Manager
With this option enabled in Cpanel you may receive a 413 Error when uploading large files like plugins to your WordPress Site.
Not it’s worth mentioning that there are potentially a couple of places that the size upload limit is set. This error relates specifically to the Nginx Manager options for caching in WHM and Cpanel that was added as an option in 2021.
There are also options in the MultiPHP INI Editor to se the upload_max_filesize that we are presuming you have already set in your WHM configuration panel.
So assuming that you have previously set these limits and have had no trouble uploading things like large plugins for WordPress or images etc, then you will likely find that the error for 413 is related to the enabling of Nginx in the recent whm update.
The solution for 413 Request Entity Too Large
To fix the issue you will need to edit the Nginx.conf file on your web server. This file among other things controls the configuration settings for allowing larger uploads. It has defaulted to a small size to avoid denial of service attacks where people try to throw large files at your site and block it from general access.
Editing conf files can be done using various linux editors. We suggest Nano as it is easy for those who like me are simple. If nano is not installed you can follow these instructions here: https://phoenixnap.com/kb/use-nano-text-editor-commands-linux
Login to your WHM Management and search for Terminal and select it. (Note that if you have the skills you can also connect to your server using your favourite Terminal software as a root user, we are using the web interface here as it is easier).
Use nano text editor:
$ sudo nano /etc/nginx/nginx.conf
Add the following line to the end of the http or server or location context to increase the size of the Nginx.conf size limit
# set client body size to 20M #
(Note that the 20 M is for 20 meg. You can set it to any size you like and should probably match the size set in the MultiPHP INI for the PHP versions that you set in WHM.)
Once you have edited the file you can Exit using the Control X keys.
Then search for in WHM your Nginx Manager.
Click on the Restart Nginx button.
That is it and should get you running.