nginx.conf默认配置说明

默认安装的1.16.1版本的nginx.conf配置文件如图:

默认安装后用普通用户检查配置文件会发现报错:

[wps@bogon ~]$ nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2020/05/19 13:02:25 [warn] 10218#10218: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2020/05/19 13:02:25 [emerg] 10218#10218: open() "/var/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

   因为安装用了sudo,所以,默认安装需要切换到root用户:

su   root

nginx -t

如图:

扫描二维码关注公众号,回复: 11221390 查看本文章

猜你喜欢

转载自www.cnblogs.com/xiongzaiqiren/p/12916356.html