Nginx Server unable to start up due to issues with conf?

November 4, 2019 199 views
Nginx

Last week I had setup Nginx fully and as far as I knew it was working, until I tried using gunicorn which I had no success with Gunicorn in the end. Then I noticed issues with DOSS attacks coming in and i am unsure if somethings happened to cause my Nginx sever from starting up.

I have accessed both files and they seem to be okay but the main nginx.conf under sites enabled will not save for some reason and file also appears empty?

root@ubuntu-vpc-do-moon:~# /etc/init.d/nginx status
● 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 Mon 2019-11-04 10:54:44 UTC; 1min 43s ago
Docs: man:nginx(8)
Process: 2550 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Nov 04 10:54:44 ubuntu-vpc-do-moon systemd[1]: Starting A high performance web server and a reverse proxy server…
Nov 04 10:54:44 ubuntu-vpc-do-moon nginx[2550]: nginx: [emerg] open() “/etc/nginx/sites-enabled/nginx.conf” failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
Nov 04 10:54:44 ubuntu-vpc-do-moon nginx[2550]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 04 10:54:44 ubuntu-vpc-do-moon systemd[1]: nginx.service: Control process exited, code=exited status=1
Nov 04 10:54:44 ubuntu-vpc-do-moon systemd[1]: nginx.service: Failed with result ‘exit-code’.
Nov 04 10:54:44 ubuntu-vpc-do-moon systemd[1]: Failed to start A high performance web server and a reverse proxy server.

Any information would be much appreciated

1 Answer

Hi @indigobsk,

Looking at the error log provide from nginx it seems in your /etc/nginx/nginx.conf file on line 62, there is a path/directory which doesn’t actually exist. Most probably, you’ve made a typo somewhere on the line.

I’ll recommend reviewing the file and making sure this do actually exist.

Regards,
KDSys

Have another answer? Share your knowledge.