Я установил проект Django на CentOS 6.5 с Nginx и uwsgi.
Я получаю ошибку при доступе к статическому содержимому, как показано ниже (/var/log/nginx/error.log) - 2015/11/02 19:05:37 [ошибка] 29701 # 0: * 52 open () "/ home / amar /workspace/myproj/config/static/rest_framework/js/default.js "не удалось (13: разрешение отказано), клиент: 172.29.100.104, сервер: myapi.dev, запрос:" GET / static / rest_framework / js / default. js HTTP / 1.1 ", хост:" myapi.dev ", реферер:" http://myapi.dev/api/v1/datasets/ "
Мой /etc/nginx/conf.d/virtual.conf выглядит так, как показано ниже -
# mysite_nginx.conf
# the upstream component nginx needs to connect to
upstream django {
server unix:///tmp/uwsgi.sock; # for a file socket
#server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
#
#API
#
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name myapi.dev; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
location /static {
autoindex on;
alias /home/amar/workspace/myproj/config/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed
}
}
Вот мой файл uwsgi.ini:
[uwsgi]
chdir = /home/amar/workspace/myproj
#home = %(base)/.virtualenvs/myproj
module = config.wsgi:application
home = /home/amar/.virtualenvs/myproj
master = true
processes = 3
socket = /tmp/uwsgi.sock
chmod-socket = 777
vacuum = true
Может ли кто-нибудь указать мне правильное направление?