加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

getgrenam(“user”)在/etc/nginx/nginx.conf中失败

发布时间:2020-12-13 21:26:29 所属栏目:Nginx 来源:网络整理
导读:我试图以当前用户(= ayush)运行nginx.但是在设置user指令时出现以下错误: Dec 11 22:26:13 manjaro nginx[17194]: 2015/12/11 22:26:13 [emerg] 17194#0: getgrnam("ayush") failed in /etc/nginx/nginx.conf:1Dec 11 22:26:13 manjaro systemd[1]: nginx.s

我试图以当前用户(= ayush)运行nginx.但是在设置user指令时出现以下错误:

Dec 11 22:26:13 manjaro nginx[17194]: 2015/12/11 22:26:13 [emerg] 17194#0: getgrnam("ayush") failed in /etc/nginx/nginx.conf:1
Dec 11 22:26:13 manjaro systemd[1]: nginx.service: Control process exited,code=exited status=1

我的nginx.conf:

user ayush;
worker_processes 1;

error_log  /var/log/nginx/error.log;
events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #access_log  logs/access.log  main;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;


        location / {
            root   /code/server;
            autoindex on;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
    }
}

也:

ayush@manjaro ~> whoami
ayush
user指令有两个参数,即用户和组名.如果您未指定组名,则假定它与您的用户名相同.

该错误是因为组名称ayush不存在.

有关详情,请参见this document.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读