Report this

What is the reason for this report?

Nginx gives an error when I run sudo systemctl restart nginx.

Posted on July 12, 2021

Hello I host a django website and set all thing then I run sudo systemctl restart nginx in my server it gives me an error that Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. then I run systemctl status nginx.service it shows me that

nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:> Active: failed (Result: exit-code) since Mon 2021-07-12 06:39:25 UTC; 1min> Docs: man:nginx(8) Process: 30855 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_proc>

then I run sudo ufw allow "Nginx Full and then I run sudo ufw status its give me the result that

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
8000                       ALLOW       Anywhere
Nginx Full                 ALLOW       Anywhere
Nginx HTTP                 ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
8000 (v6)                  ALLOW       Anywhere (v6)
Nginx Full (v6)            ALLOW       Anywhere (v6)
Nginx HTTP (v6)            ALLOW       Anywhere (v6)

then I run again systemctl status nginx.service but it gives me error again and again that

nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:> Active: failed (Result: exit-code) since Mon 2021-07-12 06:39:25 UTC; 1min> Docs: man:nginx(8) Process: 30855 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_proc>

So please tell me what can I do to solve this problem



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

Hi there,

It sounds like that there might be another service already listening on that port. You could check this with the following command:

netstat -plant | grep 80

Also, what is the output of the journalctl -xe command?

If this does not provide enough information, I could suggest checking the Nginx error log:

tail -100 /var/log/nginx/error.log

Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.