当我使用systemctl start nginx.service或者service nginx start命令启动nginx,发现启动失败,报错信息如下:

Nginx启动异常及解决方案:Failed to start SYSV: NGINX is an HTTP(S) server, HTTP(S) reverse proxy

 

 

当使用nginx -t却显示OK.查看状态,信息如下:

Nginx启动异常及解决方案:Failed to start SYSV: NGINX is an HTTP(S) server, HTTP(S) reverse proxy

 

 

解决办法:

根据Nginx配置文件查看配置的端口(本文中使用的是80端口),然后根据端口查看端口占用情况。

Nginx启动异常及解决方案:Failed to start SYSV: NGINX is an HTTP(S) server, HTTP(S) reverse proxy

 

 

修改/etc/nginx/nginx.conf文件和/usr/local/nginx-1.20.1/conf/nginx.conf文件端口为8088,重新启动nginx。

Nginx启动异常及解决方案:Failed to start SYSV: NGINX is an HTTP(S) server, HTTP(S) reverse proxy

 

 查看nginx进程

 

Nginx启动异常及解决方案:Failed to start SYSV: NGINX is an HTTP(S) server, HTTP(S) reverse proxy

 

访问nginx

 Nginx启动异常及解决方案:Failed to start SYSV: NGINX is an HTTP(S) server, HTTP(S) reverse proxy