Page 1 of 1

No nginx error log

Posted: Mon Aug 12, 2019 1:57 pm
by Pinakas
Hello,
I run our server on Ubuntu 16.04.

Lets assume that the service nginx Stoped working for whatever reason.

BY going to /var/log/nginx error log there is nothing written.. So I assume that for a reason the log is disabled.
I went to /etc/nginx/nginx.conf but there is no option to enable nginx error reporting.
So how can we enable nginx error log? And as web admin in case of nginx failure how we identify the problem? If there are no nginx logs

On apache everything can be found on error logs
Thanks

Eleftherios

Re: No nginx error log

Posted: Mon Aug 12, 2019 2:35 pm
by grayfolk
Pinakas wrote:
Mon Aug 12, 2019 1:57 pm
Hello,
I run our server on Ubuntu 16.04.

Lets assume that the service nginx Stoped working for whatever reason.

BY going to /var/log/nginx error log there is nothing written.. So I assume that for a reason the log is disabled.
I went to /etc/nginx/nginx.conf but there is no option to enable nginx error reporting.
So how can we enable nginx error log? And as web admin in case of nginx failure how we identify the problem? If there are no nginx logs

On apache everything can be found on error logs
Thanks

Eleftherios
If you use Apache as backend, nginx logs will be placed in the same logs with Apache:
https://github.com/serghey-rodin/vesta/ ... ult.tpl#L4
https://github.com/serghey-rodin/vesta/ ... lt.tpl#L13

Re: No nginx error log

Posted: Mon Aug 12, 2019 3:39 pm
by Pinakas
Thanks...

I have nginx as proxy server.

Even if the nginx.conf file states the location in apache same logs
"error_log /var/log/%web_system%/domains/%domain%.error.log error;"

I stop the nginx service (for educational purposes)
the site goes down but even with tail -f the /var/log/apache2/domain/file.error.log does not show any indication that nginx is down


How would you inspect the the site's problem caused by a stopped nginx service?






If you use Apache as backend, nginx logs will be placed in the same logs with Apache:
https://github.com/serghey-rodin/vesta/ ... ult.tpl#L4
https://github.com/serghey-rodin/vesta/ ... lt.tpl#L13
[/quote]

Re: No nginx error log

Posted: Mon Aug 12, 2019 7:32 pm
by grayfolk
Pinakas wrote:
Mon Aug 12, 2019 3:39 pm

I stop the nginx service (for educational purposes)
the site goes down but even with tail -f the /var/log/apache2/domain/file.error.log does not show any indication that nginx is down
Sure, no logs, because no errors - you just stop nginx - why this should be an error?
You will see errors if nginx was crashed, or return 5xx response.

Re: No nginx error log

Posted: Mon Aug 12, 2019 7:47 pm
by Pinakas
I think you are correct grayfolk
I thought that nginx would give error details.. But is not error

But same procedure (closing apache or mysql) gives error log on error.log

Eleftherios

Re: No nginx error log

Posted: Tue Aug 13, 2019 6:42 am
by plutocrat
Did you try looking in the systemctl logs? That's where I'd start for a service.

Code: Select all

systemctl status nginx.service 
journalctl -xe 
and maybe test the nginx config with

Code: Select all

nginx -t