Hello I really need help with my static files Can someone give me step by step process on how to serve the static files
server{
listen 80;
server_name muzilla-mp3.com www.muzilla-mp3.com;
location /static {
root /usr/local/var/www/example.com/htdocs;
}
}
htdocs have all my static files
STATIC_URL = '/static/'
STATIC_ROOT = '/usr/local/var/www/example.com/htdocs'
I am using a template and dont know how it works
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!
What you have above should work for requests for files in the directory below.
/usr/local/var/www/example.com/htdocs/static
… though it won’t handle requests for anything else, so if a file is located anywhere other than within that directory, NGINX won’t serve it.
If you’re seeing errors, please run:
tail -20 /var/log/nginx/error.log
… and paste the output in a code block.
I dont have to add nothing in my code like {% load static from staticfiles %}
Do not forget to configure these files:
/etc/systemd/system/gunicorn.socket /etc/systemd/system/gunicorn.service
very careful with the user sammy, replace with the real user
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.