Nginx status check fails. How is that possible?Syntax is OK, and the process is running:[root@vps-20176 /]# nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful[root@vps-20176 /]# ps -aux | grep nginxroot      10937  0.0  0.4 122240  2068 ?        Ss   01:22   0:00 nginx: master process nginxnginx     10938  0.0  0.6 122668  3312 ?        S    01:22   0:00 nginx: worker processroot      12020  0.0  0.2 112648   972 pts/0    R+   03:05   0:00 grep --color=auto nginxBut the status check fails:[root@vps-20176 /]# service nginx statusRedirecting to /bin/systemctl status  nginx.service nginx.service - The nginx HTTP and reverse proxy server   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)   Active: failed (Result: exit-code) since Thu 2016-10-27 02:13:47 EEST; 55min ago  Process: 11821 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)  Process: 11817 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)  Process: 11816 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)Oct 27 02:13:46 vps-20176.vps-default-host.net nginx[11821]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)Oct 27 02:13:47 vps-20176.vps-default-host.net nginx[11821]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)Oct 27 02:13:47 vps-20176.vps-default-host.net nginx[11821]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)Oct 27 02:13:47 vps-20176.vps-default-host.net systemd[1]: nginx.service: control process exited, code=exited status=1Oct 27 02:13:47 vps-20176.vps-default-host.net systemd[1]: Failed to start The nginx HTTP and reverse proxy server.Oct 27 02:13:47 vps-20176.vps-default-host.net systemd[1]: Unit nginx.service entered failed state.Oct 27 02:13:47 vps-20176.vps-default-host.net systemd[1]: nginx.service failed.Oct 27 02:13:47 vps-20176.vps-default-host.net nginx[11821]: nginx: [emerg] still could not bind()Oct 27 02:14:33 vps-20176.vps-default-host.net systemd[1]: Stopped The nginx HTTP and reverse proxy server.Oct 27 02:15:15 vps-20176.vps-default-host.net systemd[1]: Unit nginx.service cannot be reloaded because it is inactive.Update:Try stopping nginx:service nginx stopCheck the nginx still running:ps ax | grep nginxAnd if still running, kill the process:kill -p PIDCheck nginx status, will not run:ps ax | grep nginxAnd then do a clean-start:service nginx startThat worked for me.
Nginx status check failure (CentOS)
centos;nginx