Attempting file uploads on the websites don't compete, or they fail. The Nginx log will show the below similar errors:
Note: The Nginx error log can be located at path: "
*494756 client intended to send too large body: 1778270 bytes
Nginx has a limit on the body size by default. If the limit is exceeded, an error will occur log file, and most commonly, it will be observed on the website as a failure to upload the files.
The Nginx configuration will need to be modified to allow larger upload sizes. The desired upload size will need to be set with the option: "
client_max_body_size" in the Nginx configuration.
Note: This also assumes that the PHP INI configurations have already been adjusted to include the higher upload/post limits.
The below changes will need to be made in the SSH/Terminal via editing files with a text editor for Linux like vi, vim, or nano. It is strongly recommended to make these changes with an administrator's assistance to prevent issues in the configuration file. Making the wrong change could cause the service to go offline.
1. Edit the "
http" block: ( Will apply settings globally )
Create a new file in the conf.d directory for Nginx.
2. Edit the new file: "
/etc/nginx/conf.d/maxuploadsize.conf" to add below syntax to set 500m limit:
3. Restart Nginx and FPM.
For more information on customizing Nginx settings, it is best to review the official documentation page.