django nginx media files -


server {  #listen 443;  server_name www.site.md;   location ~* .(jpg|svg|jpeg|gif|png|ico|css|zip|rar|pdf)$ {  root /home/ubuntu/giver;  error_page 404 = 404;  }    location = /favicon.ico { access_log off; log_not_found off; }  location /static/ {  root /home/ubuntu/giver;  }   location / {  include proxy_params;  proxy_pass http://unix:/home/ubuntu/giver/server/giver/giver.sock;  }   location /media {  root /home/ubuntu/giver/server/giver/giver/media; # django project's media files - amend required  }  

as see, have added path media files, not load... can me, please? use django 1.10, nginx, gunicorn on ubuntu 16.

try changing root alias:

location /media/ {      alias /home/ubuntu/giver/server/giver/giver/media/; } 

then restart:

sudo service nginx restart 

hope helps!


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -