I recently switched the web server on my CentOS 7 machine from Apache to nginx. Originally, I had added my user account to the apache
group and then did a recursive chown
to make all files in the public web root belong to the user and group apache
. With this, I was able to successfully edit files as my own user without root privileges.
However, the reverse is not working in nginx. I added my user account to the nginx
group (as specified in the nginx.conf
file) and I was unable to edit existing files, add new files or directories, or anything of the sort. The only workaround was to add my user as the owner of the public web roots. Ideally, I would prefer to just have nginx as the user and group and have my user account be able to access files that way.
Is there a reason I cannot edit files owned by the nginx
user and group despite my user account belonging to the nginx
group? I am confused about how to debug this further. Thanks.