File upload limit in Nginx & (The server returned a "413 Content Too Large")
✔ Recommended Answer
You also have to edit your php.ini
which is currently loaded. You can find this from <?php phpinfo();
then edit the following.
memory_limit = 64Mupload_max_filesize = 100Mpost_max_size = 100M
Source: stackoverflow.com
Answered By: Michael Mano
client_max_body_size
directive in the Nginx configuration file.If you are seeing the "413 Content Too Large" error, it means that the size of the file being uploaded exceeds the limit set by client_max_body_size
.
To increase the limit, you need to edit the Nginx configuration file (usually located in /etc/nginx/nginx.conf
or /etc/nginx/conf.d/default.conf
) and add or modify the client_max_body_size
directive to a value that suits your needs. For example, to allow file uploads of up to 100MB, you can add the following line to your configuration file:
client_max_body_size 100m;
Note that increasing the file upload limit can have security implications, as it may allow users to upload large files that could potentially overwhelm the server or cause other problems. It is therefore important to set a reasonable limit based on your server's resources and requirements.sudo service nginx restart
Comments
Post a Comment