Report this

What is the reason for this report?

Restarting Nginx – what does this error message mean?

Posted on December 28, 2018

I followed the official DO tutorial in setting up Nginx server blocks and somehow always end up with an error message that is quite cryptic for me as a beginner. Going back every step I did before I checked for little typing errors, but no semicolons or other things seemed to be missing. Can someone give me a hint what this error message means?

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

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.

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: en
     Active: failed (Result: exit-code) since Fri 2018-12-28 10:42:09 UTC; 10s ago
       Docs: man:nginx(8)
    Process: 4686 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code
    Process: 4676 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process

Thanks a lot in advance for any help!



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.

@retador

Would you be able to provide the output from the following command?

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

Tailing the logs may provide a bit more specific detail on what may be causing NGINX to fail to start if you’re not seeing anything in the systemctl or journal output.

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.