网站在运行一段时间后,无法新增网站,且打开部分网站报404错误,SHELL重启GNINX时会出现以下错误
nginx: [emerg] listen() to 0.0.0.0:62, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:62, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:62, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:62, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:62, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: [emerg] still could not bind()
这种情况一般是NGINX在配置相关的SSL证书时出现此类错误,仅需要执行以下命令,可恢复
sudo fuser -k 443/tcp service nginx restart
查找到对应进程并杀死它,最后重启nginx