nginx进行项目域名配置时提示Job for nginx.service failed

Posted JonlysLee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx进行项目域名配置时提示Job for nginx.service failed相关的知识,希望对你有一定的参考价值。

ps aux | grep  nginx 
/bin/systemctl stop nginx.service
/bin/systemctl start nginx.service
/bin/systemctl restart nginx.service
/bin/systemctl reload nginx.service
提示错误:Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. error.log

解决问题:提示这个错误请不要去网上找那些没有用的回答,提示错误已经提示的很明显了, 让我们去var/log/nginx下面看下error.log文件吧

我的提示两个错误:
1、nginx open() "" failed (13: Permission denied), client
解决办法:给域名访问日志保存路径文件设置777权限

2、Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8095 failed (13: Permission denied)
解决办法:权限拒绝,经检查发现是开启selinux 导致的
getenforce 查看是否开启了selinux  [disabled 或 permissive是关闭, enforcing是开启]

setenforce 0    ##设置SELinux 成为permissive模式
setenforce 1    ##设置SELinux 成为enforcing模式

  

以上是关于nginx进行项目域名配置时提示Job for nginx.service failed的主要内容,如果未能解决你的问题,请参考以下文章

nginx配置同一域名下,共存2个nodejs项目

nginx提示Job for nginx.service failed because the control的问题

nginx 本地怎么配置多项目的访问

nginx启动报错:Job for nginx.service failed. See 'systemctl status nginx.service' and 'journa

Nginx——Nginx启动报错Job for nginx.service failed because the control process exited with error code(代码片段

centos nginx server_name 配置域名访问规则