我用nginx和gunicorn托管了django。我得到以下错误。无法使用gunicorn运行nginx,在连接到上游时获取权限被拒绝错误
# 1 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 106.77.61.123, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8001/favicon.ico", host: "<domainname>
[相同配置的工作我的本地CentOS的机器上]
但在VPS托管环境(VPS):
我用的CentOS-7的用户名 “ftpuser1”( nginx.conf中的用户名是“ftpuser1”)。
我正在使用用户nginx的 “ftpuser1”
所有者的/ var /缓存/ nginx的是 “ftpuser1” 与777个权限源代码路径的递归
所有者也是 “ftpuser1” 与777个权限递归
这里是我的/etc/nginx/conf.d/default.config配置文件的内容:
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location/{
root /home/ftpuser1/donation/templates;
index home.html;
proxy_pass http://127.0.0.1:8001;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#} }
谁能帮我在这?
检查是否有任何其他内容正在使用'netstat -tulpn | grep 8001' – 2014-09-06 14:05:09