By XeroxToXerox
I deployed strapi to digital ocean using the one-click guide (https://strapi.io/documentation/3.0.0-beta.x/installation/digitalocean-one-click.html). Everything works fine, but when i try to upload an image to the media library i always get the message (Request Entity Too Large).
I tried:
Going to plugins and upload with no success since there is no such plugin available with that name (the only ones are CONTENT MANAGER, CONTENT TYPE BUILDER, EMAIL, MEDIA LIBRARY, ROLES & PERMISSIONS.
Going to the console and trying to change strapi configs, but i cant access with sudo since all the passwords i try are incorrect (i used all of them, none work)
I am now clueless of what i am suposed to do.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I just ran into this issue myself. It turns out that it is actually NGINX causing this issue, rather than strapi.
This can be verified by opening the networking tab in the browser dev tools, then triggering the error. The request status should be 413. Click on the failing request then select the ‘Response’ tab. It should be an NGINX error page including “413 Request Entity Too Large” and “nginx/1.14.2” (your version number may differ).
I see you are having problems with sudo. What user are you SSHing into the droplet as? I believe the digital ocean default is root. If you SSH in as root, you do not need to use sudo. sudo is used to give root powers to non-root users. So if you are root, just omit the sudo part of the command.
Once I confirmed NGINX to be the culprit, I found this serverfault post with the answer. To summarize the relevant parts of that post and expand a bit (all commands should be run as root):
nano /etc/nginx/nginx.confclient_max_body_size in the http block or add it if it doesn’t exist. I picked 20MB as max: client_max_body_size 20M;nginx -tsystemctl restart nginxsystemctl status nginx (look for “Active: active(running)” in the output)This resolved the error for me. Let me know if that works for you, or if you need me clarify anything. Best of luck!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.