Nginx | configuration file /etc/nginx/nginx.conf test failed

5 篇文章 0 订阅

一、报错

# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 一 2024-02-26 10:49:11 CST; 3min 8s ago
  Process: 2648 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
  Process: 2647 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net systemd[1]: Starting The nginx HTTP and reverse proxy server...
226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net nginx[2648]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net nginx[2648]: nginx: [emerg] open() "/etc/nginx/flschat_access.log" failed (13: Permis...nied)
226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net nginx[2648]: nginx: configuration file /etc/nginx/nginx.conf test failed
226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net systemd[1]: nginx.service: control process exited, code=exited status=1
226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net systemd[1]: Unit nginx.service entered failed state.
226 10:49:11 pool-100-0-43-111.bstnma.fios.verizon.net systemd[1]: nginx.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

二、解决方法

关闭防火墙
systemctl disable firewalld
systemctl stop firewalld

关闭iptables
iptables -F

关闭selinux
1、临时
getenforce
setenforce 0
2、永久
修改配置文件 vim /etc/selinux/config SELINUX=enforcing改为disabled
ELINUX=disabled

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值