Can't restart Nginx - Job for nginx.service failed because the control process exited with error code

Viewed 550

I'm currently following a guide on how to setup Nginx on Ubuntu 20.04. I set up the Nginx configuration files and tested them succesfully.

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

All went well until I had to restart Nginx.

$ sudo systemctl restart nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

I tried both "systemctl status nginx.service" and "journalctl -xe" to find the issue.

systemctl

$ systemctl status nginx.service
ā— nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-10-15 16:50:23 CEST; 1min 45s ago
       Docs: man:nginx(8)
    Process: 14387 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 14388 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)

journalctl

$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
-- Logs begin at Fri 2021-10-15 16:36:52 CEST, end at Fri 2021-10-15 16:36:54 CEST. --
okt 15 16:36:52 h999.stratoserver.net gunicorn[14199]: [2021-10-15 16:36:52 +0200] [14199] [INFO] Starting gunicorn 20.1.0
okt 15 16:36:52 h999.stratoserver.net gunicorn[14199]: [2021-10-15 16:36:52 +0200] [14199] [INFO] Listening at: unix:/run/gunicorn.sock (14199)
okt 15 16:36:52 h999.stratoserver.net gunicorn[14199]: [2021-10-15 16:36:52 +0200] [14199] [INFO] Using worker: sync
okt 15 16:36:52 h999.stratoserver.net gunicorn[14201]: [2021-10-15 16:36:52 +0200] [14201] [INFO] Booting worker with pid: 14201
okt 15 16:36:53 h999.stratoserver.net gunicorn[14202]: [2021-10-15 16:36:53 +0200] [14202] [INFO] Booting worker with pid: 14202
okt 15 16:36:53 h999.stratoserver.net gunicorn[14203]: [2021-10-15 16:36:53 +0200] [14203] [INFO] Booting worker with pid: 14203
okt 15 16:36:54 h999.stratoserver.net gunicorn[14201]: Not Found: /
okt 15 16:36:54 h999.stratoserver.net gunicorn[14201]:  - - [15/Oct/2021:14:36:54 +0000] "GET / HTTP/1.1" 404 4753 "-" "curl/7.68.0"

Looking at the error logs I'm not sure what the issue is. Is it the "Not Found: /"? If so, what exactly is not found? I'm confused because shouldn't it be able to restart if the tests passed? At least that's what the guide said.

Any help would be greatly appreciated.

0 Answers
Related