Home  >  Q&A  >  body text

How does nginx's www-data user access other users' files?

In the ubuntu server environment, nginx is installed.
In nginx.conf, the default value of the "user" node is "www-data". That is, owned by the www-data user.
The html file of my website is under another user nguser, and the directory is /home/nguser/website

Now I changed the "root" in nginx.conf to /home/nguser/website, and a 404 error occurred while browsing.
Someone told me that this is a permissions issue, saying that the www-data user cannot access the content of the nguser user.

I am a beginner in linux and nginx. I don’t know how to solve this problem. Please give me an answer!

仅有的幸福仅有的幸福2713 days ago936

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 17:25:34

    chmod -R 777 /home/nguser/website

    reply
    0
  • Cancelreply