1

I'm running a uwsgi app that creates a unix socket in /home/user/myapp.sock and nginx has been given the right permissions to access the file, however, selinux isn't letting me connect to it:

avc:  denied  { write } for  pid=11246 comm="nginx" name="myapp.sock"

My /home/user dir is labeled as:

drwxr-x---.  6 hibasa hibasa unconfined_u:object_r:httpd_sys_content_t:s0  4096 feb 13 09:14 .

and the socket:

srw-rw-rw-.  1 hibasa hibasa unconfined_u:object_r:httpd_sys_content_t:s0     0 feb 13 08:59 myapp.sock

But what is the correct combination of labels for the parent dir and the socket to let NGINX connect to it?

Everything works fine if I just setenforce 0 as root but I don't really want to disable SELinux completely

  • Do you have a (more) complete AVC message (audit log /var/log/audit/audit.log)? – sebasth Feb 13 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.