getgrnam("user") failed in /etc/nginx/nginx.conf

The user directive takes two parameters, your user and your group name. If you do not specify a group name, it assumes it's the same as your username.

The error is because the group name ayush does not exist.

See this document for details.


In MacOS group name is a number (Use the command: id -g -n $whoami or open MacOS Setting -> Users and Groups -> Right click on your account and choose Advanced Options). But nginx only work if I specify the group name as 'staff'.

My nginx config:

user MyUserName staff; ...