【发布时间】:2015-03-29 12:20:40
【问题描述】:
如标题中所述,我在 CentOS 6.4 中的 nginx + uwsgi 设置中遇到权限被拒绝错误。我已经以 root 身份运行 uwsgi。下面是我的配置文件。请注意,我已经将 mysite_nginx.conf 链接 (ln -s) 到 /etc/nginx/sites-enabled/。另外我已经将 /home/user1/location/mysite 的所有者更改为 nginx 用户。
mysite_uwsgi.ini
#mysite_uwsgi.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /home/user1/location/mysite/myapp
# Django wsgi file
module = mysite.wsgi
# the virtualenv (full path)
home = /home/user1/location/mysite
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 4
# the socket (use the full path to be safe
socket = /home/user1/location/mysite/myapp/myapp.sock
# ... with appropriate permissions - may be needed
chmod-socket = 666
chown-socket = nginx:nginx
# clear environment on exit
vacuum = true
# other config options
uid = nginx
gid = nginx
processes = 4
mysite_nginx.conf
# mysite_nginx.conf
# the upstream component nginx needs to connect to
upstream mysite {
server unix:///home/user1/location/mysite/myapp/myapp.sock; se this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 8082;
# the domain name it will serve for
server_name 192.168.X.X; #
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /home/user1/location/mysite/media;
}
location /static {
alias /home/user1/location/mysite/static;
}
我已经在 stackoverflow 中关注了与同一问题相关的答案,但它们都没有帮助。我缺少什么?做错了吗?
提前致谢!
【问题讨论】:
-
感谢您的反馈。我不小心删除了 audit.log 的条目,但经过检查,与我的设置/请求无关。我应该将其设置为允许还是禁用它?
-
This 可能会有所帮助。