I first tryed installing nginx from the config menu of my home automation server (Openhabian). But this ended in errors.
So I uninstalled nginx and removed all related directories to start over.
I followed your howto about installing nginx on debian 10 but after installation is finished I get an error. I didn ’t write it down, but it was vague. Then I tried systemctl status nginx:

* 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 Tue 2020-05-05 13:39:12 CEST; 11min ago
     Docs: man:nginx(8)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

and 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 Tue 2020-05-05 13:52:47 CEST; 30s ago
     Docs: man:nginx(8)
  Process: 2822 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAIL
lines 1-5/5 (END)

Hen I go to my server-IP I do get the nginx-landing page. But when I do: ‘sudo systemctl reload nginx’

I get:

nginx.service is not active, cannot reload.

The command: 'journalctl -xe’ gives me a lot of line that I understand nothing about and I don’t find any relation with nginx I think:

-- The unit UNIT has successfully entered the 'dead' state.
mei 05 13:38:42 HABIAN systemd[2022]: Closed GnuPG cryptographic agent (ssh-agent emulation).
-- Subject: A stop job for unit UNIT has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit UNIT has finished.
--
-- The job identifier is 20 and the job result is done.
mei 05 13:38:42 HABIAN systemd[2022]: dbus.socket: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support

I hope you can help me?

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.

×
2 answers

Hi @guidovanhaasteren,

Most probably you’ve made a mistake somewhere in your Nginx configuration file. To check the exact error, I’ll recommend going over your Nginx error log right after trying to restart the service. The error log should provide you with the exact error it’s experiencing.

To check the error log, you can use the following command

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

In another SSH window,try restarting the Nginx service and then check the log and it’s output.

With the error you have now, you should be able to go further and troubleshoot your Nginx. If you are still unable to post the error here and I’ll assist you.

Regards,
KDSys

Hi @guidovanhaasteren,

If you’re trying to start the Nginx service and encountering the error message, So the solution is, Go to Digitalocean Cloud panel and restart your server.

This may help you, If it doesn’t work, then you can remove the Nginx and install it again.

Thanks

Submit an Answer