Nginx error: (13: Permission denied) while connecting to upstream

后端 未结 6 1912
时光取名叫无心
时光取名叫无心 2020-12-02 17:10

I am getting this error in my nginx-error.log file:

2014/02/17 03:42:20 [crit] 5455#0: *1 connect() to unix:/tmp/uwsgi.sock failed (13: Permissi         


        
6条回答
  •  难免孤独
    2020-12-02 17:18

    While the accepted solution is true there might also SELinux be blocking the access. If you did set the permissions correctly and still get permission denied messages try:

    sudo setenforce Permissive
    

    If it works then SELinux was at fault - or rather was working as expected! To add the permissions needed to nginx do:

      # to see what permissions are needed.
    sudo grep nginx /var/log/audit/audit.log | audit2allow
      # to create a nginx.pp policy file
    sudo grep nginx /var/log/audit/audit.log | audit2allow -M nginx
      # to apply the new policy
    sudo semodule -i nginx.pp
    

    After that reset the SELinux Policy to Enforcing with:

    sudo setenforce Enforcing
    

提交回复
热议问题