简体   繁体   English

NginX许可被拒绝13

[英]NginX permission denied 13

I have come upon a permissions problem with my engine-X when following the tutorial on 我在遵循教程时遇到了我的engine-X的权限问题

http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html

I've tried the suggested workarounds found in simillar questions but none of them was any help. 我尝试过在simillar问题中找到的建议的解决方法,但没有一个是有任何帮助的。 (setting Selinux to permissive, adding chmods for uwsgi or even running nginx as root) (将Selinux设置为允许,为uwsgi添加chmods甚至以root身份运行nginx)

Here's a dump of the error from nginx error.log Anyone got any ideas? 这是从nginx error.log的错误转储谁有任何想法? I probably won't be using nginx with virtualenv if this cannot be fixed. 如果无法修复,我可能不会将nginx与virtualenv一起使用。

[crit] 3123#0: *3 connect() to unix:///home/mb/uwsgi-tutorial/mysite mysite.sock failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///home/mb/uwsgi-tutorial/mysite/mysite.sock:", host: "localhost:8000"

EDIT: Disabling SELinux fixes the problem for the TCP_socket (that was a problem too apparently) and then everything works. 编辑:禁用SELinux修复TCP_socket的问题(这显然是一个问题),然后一切正常。

Disabling SELinux doesn't fix the permission problem for Unix_domain socket Nxinx is not allowed to use the socket even with chmod 777 (I know this should not be done). 禁用SELinux不会修复Unix_domain套接字的权限问题即使使用chmod 777,也不允许Nxinx使用套接字(我知道不应该这样做)。

then probably you need to manage the permissions on the socket so that nginx is allowed to use it. 那么可能你需要管理套接字上的权限,以便允许nginx使用它。

Try: 尝试:

uwsgi --socket mysite.sock --wsgi-file test.py --chmod-socket=666 

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM