Background description:
When installing nginx with root, why do you need to create a www user? At first, I thought that only the www folder can be accessed after nginx is installed, but I found that the root folder can also be accessed (even if the top configuration If the root
in the file is /
and there is an html file), then what is the use of creating a www user? I have this question and I want to ask everyone.
Establishing a running user of
www
用户的目的是为了访问控制,特别是写入权限的控制。默认情况下用户自己的目录对其他用户只开放读取权限,如果使用www
来作为nginx
can well protect other programs in the system from being destroyed due to negligence or loopholes in the writing of the server program.