简体   繁体   English

Nginx(13:权限被拒绝)同时连接到上游

[英]Nginx (13: Permission denied) while connecting to upstream

I'm deploying my Djano application on a VPS and I'm following the steps in the below link to configure my app with Gunicorn and Nginx.我正在 VPS 上部署我的 Djano 应用程序,并按照以下链接中的步骤使用 Gunicorn 和 Nginx 配置我的应用程序。

How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04 如何在 Ubuntu 16.04 上使用 Postgres、Nginx 和 Gunicorn 设置 Django

Everything went well with the tutorial (gunicorn and nginx are running) but the issue is that when Im' visiting the VPS through the static IP its showing a white screen that is always reloading.本教程一切顺利(gunicorn 和 nginx 正在运行)但问题是当我通过 static IP 访问 VPS 时,它总是显示白屏。

After checking nginx log I found the following:检查 nginx 日志后,我发现以下内容:

(13: Permission denied) while connecting to upstream, client: <client_ip>, server: <server_ip>, request: "GET / HTTP/1.1, upstream: "http://unix:/root/myproject/myproject.sock:/", host: "<server_ip>", referrer: "http://<server_ip>/" (13:权限被拒绝)同时连接到上游,客户端:<client_ip>,服务器:<server_ip>,请求:“GET / HTTP/1.1,上游:”http://unix:/root/myproject/myproject.sock: /",主机:"<server_ip>",引用者:"http://<server_ip>/"

After searching for roughly 7 hours, I was finally able to find a solution to this issue in the Nginx forum:找了大概7个小时,终于在Nginx论坛找到了解决这个问题的办法:

Nginx connet to.sock failed (13:Permission denied) - 502 bad gateway Nginx connet to.sock failed (13:Permission denied) - 502 bad gateway

What I simply did was changing the name of the user on the first line in /etc/nginx/nginx.conf file.我所做的只是在/etc/nginx/nginx.conf文件的第一行更改用户名。

In my case the default user was www-data and I changed it to my root machine username.在我的情况下,默认用户是www-data ,我将其更改为我的root计算机用户名。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 (13:权限被拒绝)连接到上游时:[nginx] - (13: Permission denied) while connecting to upstream:[nginx] 连接到上游时 Nginx、django、gunicorn、ubuntu 14.04(13:权限被拒绝) - Nginx, django, gunicorn, ubuntu 14.04 (13: Permission denied) while connecting to upstream 连接到上游时,Nginx + uWsgi + Django'权限被拒绝'(套接字) - Nginx+uWsgi+Django 'Permission denied while connecting to upstream' (socket) 机器重启后,“ unix:/socket/uwsgi.sock在连接到上游时失败(13:权限被拒绝)” - After machine reboot “unix:/socket/uwsgi.sock failed (13: Permission denied) while connecting to upstream” connect() 到 unix:/home/glenn/blog.sock 在连接到上游时失败(13:权限被拒绝) - connect() to unix:/home/glenn/blog.sock failed (13: Permission denied) while connecting to upstream 无法使用gunicorn运行nginx,连接到上游时出现权限被拒绝的错误 - Could not run nginx with gunicorn, getting permission denied error while connecting to upstream NginX许可被拒绝13 - NginX permission denied 13 尝试连接到上游Ubuntu 14.04 Gunicorn时,nginx权限被拒绝 - nginx permission denied while attempting to connect to upstream Ubuntu 14.04 Gunicorn Nginx 下载权限错误 - Open() 失败(13:权限被拒绝) - Nginx download permissions error - Open() failed (13: Permission denied) nginx connet to.sock failed (13:Permission denied) - 502 bad gateway - nginx connet to .sock failed (13:Permission denied) - 502 bad gateway
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM