1
votes

I have come upon a permissions problem with my engine-X when following the tutorial on

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. (setting Selinux to permissive, adding chmods for uwsgi or even running nginx as root)

Here's a dump of the error from nginx error.log Anyone got any ideas? I probably won't be using nginx with virtualenv if this cannot be fixed.

[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.

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).

1

1 Answers

0
votes

then probably you need to manage the permissions on the socket so that nginx is allowed to use it.

Try:

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