Sometime this happening because your nginx server will not enable you to upload a file that is greater than the size specified in the nginx config file. To fix that, you’ll need to change your nginx configuration.
Remove/modify your nginx config file by following the steps.
Step 1. Go to the config location and open it
sudo nano /etc/nginx/nginx.conf
or direct open in VS Code
Step 2: Search for this variable: client_max_body_size
. If you find it, just increase its size to 100M,
If it doesn’t exist, then you can add below code inside and at the end of http:
Step 3: Save this file. ( In case of terminal : If you want to save the changes you’ve made, press Control + O . To exit nano, type Control + X . If you ask nano to exit from a modified file, it will ask you if you want to save it.)
Step 4: Restart nginx to apply the changes.
sudo service nginx restart
Now you done.
That is it for today, hope it helps.
If you have a better approach to resolve this problem please make a comment in comment section below.
—
If you like this article, you can buy me a coffee. Thanks!