I can’t upload video files to my digital ocean ubuntu server. all other file uploads, images, audio and even pdf go through, i get 500 internal server error. I have tried it locally with postman and it works. I have a 4 GB Memory / 2 Intel vCPUs / 80 GB Disk / LON1 - Ubuntu 22.10 x64 droplet. I am also using Nginx to handle http requests. Even tried a video of 1mb and it still didn’t work.
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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
What I usually suggest in such cases is to follow this guide here on how to troubleshoot common Nginx errors:
And mainly these steps here:
Start by checking the Nginx Error Log:
/var/log/nginx/error.log
. You can use thetail -100 /var/log/nginx/error.log
command to check the last 100 lines of the log.Check File Size Limits:
client_max_body_size
setting which defines the maximum allowed size for client requests. If the video file exceeds this size, Nginx will respond with a413 Request Entity Too Large
error, but it’s good to double-check this setting. Even if you tried with a 1MB video, let’s confirm:sudo nano /etc/nginx/nginx.conf
client_max_body_size
. If it’s not present, add it inside thehttp
block:Restart Nginx:
sudo systemctl restart nginx
Check File Type Handling:
Check Server Resource Usage:
top
,htop
, orfree -m
to see memory usage. If your server is running out of memory, you may need to optimize your application or consider resizing your droplet.If you are using PHP, the
upload_max_filesize
andpost_max_size
inphp.ini
can also restrict the size of files you’re allowed to upload.Feel free to share any of the logs here if you wish!
Let me know how it goes!
Best,
Bobby
Heya,
A 500 Internal Server Error indicates a problem on the server side. Since you mentioned that you’re able to upload other file types, and the video file upload works locally, it sounds like there’s a configuration or permission issue specific to your server or its environment.
How are you trying to upload your video?
Additionally, have you checked your error logs, if not, please do so.
If you let me know what the error is I can help with that.