Symptoms
Attempting file uploads on the website doesn't complete or will fail, and the Nginx log contains an error similar to the following.
2025/06/19 08:58:05 [error] 419052#419052: *63 client intended to send too large body: 143058140 bytes, client: 203.0.113.2, server: domain.tld, request: "POST /upload.php HTTP/1.1", host: "domain.tld", referrer: "https://domain.tld/index.php"
Description
Nginx has a limit on the body size. Uploads that exceed this limit will fail. The desired upload size must be set with the client_max_body_size
option in the Nginx configuration.
Workaround
Please note that the following procedure assumes that the PHP INI configurations have already been adjusted to include the higher upload/post limits.
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Open
/etc/nginx/ea-nginx/settings.json
in your preferred text editor. - Change the
client_max_body_size
value to the desired size in megabytes."client_max_body_size" : "500m"
- Save the changes and exit the text editor.
- Rebuild the Nginx configuration.
/usr/local/cpanel/scripts/ea-nginx config --global
- Verify that the change worked by checking the value in the configuration file.
grep client_max_body_size /etc/nginx/conf.d/ea-nginx.conf
Additional resources
The Default Configuration of NGINX with Reverse Proxy: Configuration files
Comments
0 comments
Article is closed for comments.