При попытке перезапустить nginx получаем ошибку:
nginx restart
[....] Restarting nginx (via systemctl): nginx.serviceJob for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
failed!
Проверяем статус:
systemctl status nginx.service
nginx.service - nginx - high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Sun 2019-12-15 16:42:45 MSK; 1min 48s ago
Docs: http://nginx.org/en/docs/
Process: 12694 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 16448 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
Main PID: 5865 (code=exited, status=0/SUCCESS)
Проверяем файл конфигурации:
nginx -t -c /etc/nginx/nginx.conf
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Пробуем вылечить:
fuser -k 80/tcp
fuser -k 443/tcp
/etc/init.d/nginx restart
Проверяем:
[ ok ] Restarting nginx (via systemctl): nginx.service.