django/nginx/gunicorn - ec2 instance not serving static files
I've tried to resolve this myself, but my application on ec2 is not
getting any static files e.g. js, css, img, etc.
nginx conf looks like:
server {
server_name ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com;
access_log off;
location /static/ {
alias /home/ubuntu/virtualenv/staticfiles/;
}
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI
COM NAV"';
}
}
settings.py in django
STATIC_ROOT = '/home/ubuntu/virtualenv/staticfiles/'
I ran python manage.py findstatic img/templated/base/favicon.ico and it
came back with:
user@ip-X-X-X-X:~/virtualenv/mysite$ python manage.py findstatic
img/templated/base/favicon.ico
Found 'img/templated/base/favicon.ico' here:
/home/ubuntu/virtualenv/mysite/homelaunch/static/img/templated/base/favicon.ico
What am I doing wrong here? I'm simply trying to use the files under
/home/ubuntu/virtualenv/mysite/homelaunch/static/ and it is loading the
templates properly, but not any img, css, etc.
No comments:
Post a Comment