We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Nginx stop working with failure in configuration file
Nginx stop working with failure in configuration file
Hi,
Since a while, without (clear) reason, nginx failed periodicaly each 3 or 4 days.
The error is :
Another day, same error but with another user, and 2 times on the file : it was missing the same line, but in two places on the file !
I'm adding the missing line(s)s and I could restart properly nginx...
But what appends ?
The last time the problem occurs, it was at 1:59am
Here my syslog around this time : https://pb.spheerys.fr/?70fc083e31b9cc7 ... 0fBod2XNA=
Do you see something strange, and how this line could be delete without my intervention ????
Since a while, without (clear) reason, nginx failed periodicaly each 3 or 4 days.
The error is :
And indeed, on the first line of the file /home/User1/conf/web/snginx.conf, it's missing the following line :nginx: [emerg] "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
Code: Select all
server {
I'm adding the missing line(s)s and I could restart properly nginx...
But what appends ?
The last time the problem occurs, it was at 1:59am
Here my syslog around this time : https://pb.spheerys.fr/?70fc083e31b9cc7 ... 0fBod2XNA=
Do you see something strange, and how this line could be delete without my intervention ????
Last edited by Spheerys on Fri Nov 03, 2017 9:43 pm, edited 2 times in total.
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Nginx stop each night with failure in configuration file
Also do to check if all your confs are valid. If so, can you paste your Nginx error log ?
May be rebuild web for all users can fix this ?
Can you check if your Cron is running at that specific time? It may be causing some problem, or it can be some other cron interfering.
Code: Select all
nginx -t
May be rebuild web for all users can fix this ?
Can you check if your Cron
Code: Select all
sudo /usr/local/vesta/bin/v-update-letsencrypt-ssl
Re: Nginx stop each night with failure in configuration file
~ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Code: Select all
~ cat /var/log/nginx/error.log
2017/11/03 01:59:20 [emerg] 584#584: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:20 [emerg] 605#605: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:20 [emerg] 609#609: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:22 [emerg] 764#764: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:22 [emerg] 781#781: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:22 [emerg] 787#787: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:25 [emerg] 1033#1033: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:26 [emerg] 1050#1050: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:32 [emerg] 1343#1343: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:32 [emerg] 1359#1359: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
2017/11/03 01:59:32 [emerg] 1363#1363: "listen" directive is not allowed here in /home/User1/conf/web/snginx.conf:1
How can I do this ?May be rebuild web for all users can fix this ?
I did it for User1 with 'v-rebuild-web-domains User1' but the nginx didn't broke
When I ran manualy v-update-letsencrypt-ssl, I had this error :
And it was normal because it was a not renewed domain which was still hosted just in case. I had removed the let(s encrypt option from this domain and it was running well.~ /usr/local/vesta/bin/v-update-letsencrypt-ssl
Error: DNS problem: NXDOMAIN looking up A for not-renewed-domain.com
But even with the error, nginx didn't broke...
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Nginx stop working with failure in configuration file
so is it resolved now ?
if not, can you paste your Nginx log & error log for 5 minutes before and after the exact time it stops ? like between 1:55 to 2:05
if not, can you paste your Nginx log & error log for 5 minutes before and after the exact time it stops ? like between 1:55 to 2:05
Re: Nginx stop working with failure in configuration file
The problem occurs again this night at 1:55am, on another customer account !
On my nginx error log, I only have :
How can I activate it ?
On my nginx error log, I only have :
And my nginx access.log is empty !/var/log/nginx/error.log 807/807 100%
2017/11/04 01:56:06 [emerg] 9631#9631: "listen" directive is not allowed here in /home/NP11/conf/web/snginx.conf:1
2017/11/04 01:56:06 [emerg] 9647#9647: "listen" directive is not allowed here in /home/NP11/conf/web/snginx.conf:1
2017/11/04 01:56:06 [emerg] 9651#9651: "listen" directive is not allowed here in /home/NP11/conf/web/snginx.conf:1
2017/11/04 01:56:09 [emerg] 9798#9798: "listen" directive is not allowed here in /home/NP11/conf/web/snginx.conf:1
2017/11/04 01:56:09 [emerg] 9814#9814: "listen" directive is not allowed here in /home/NP11/conf/web/snginx.conf:1
2017/11/04 01:56:09 [emerg] 9818#9818: "listen" directive is not allowed here in /home/NP11/conf/web/snginx.conf:1
How can I activate it ?
Re: Nginx stop working with failure in configuration file
On my vesta error.log, I have this :
On /var/log/vesta/system.log :2017-11-04 01:56:07 v-delete-web-domain-ssl 'user3' 'user3.org' [Error 20]
2017-11-04 01:56:09 v-restart-proxy [Error 20]
2017-11-04 01:56:09 v-add-web-domain-ssl 'user3' 'user3.org' '/tmp/tmp.yKzT573iCc' [Error 20]
2017-11-04 01:48:59 v-add-firewall-chain 'SSH'
2017-11-04 01:48:59 v-add-firewall-ban '123.183.209.139' 'SSH'
2017-11-04 01:55:14 v-check-letsencrypt-domain 'user1' 'domain1.fr'
2017-11-04 01:55:21 v-check-letsencrypt-domain 'user1' 'domain1-fr.myserver.mycompany.net'
2017-11-04 01:55:28 v-check-letsencrypt-domain 'user1' 'www.domain1.fr'
2017-11-04 01:55:35 v-generate-ssl-cert 'domain1.fr' '[email protected]' 'US' 'California' 'San Francisco' 'Vesta' 'IT' 'domain1-fr.myserver.mycompany.net,domain1.fr,,www.domain1.fr'
2017-11-04 01:55:36 v-sign-letsencrypt-csr 'user1' 'domain1.fr' '/tmp/tmp.EZD7KrFjNZ'
2017-11-04 01:55:38 v-delete-web-domain-ssl 'user1' 'domain1.fr'
2017-11-04 01:55:40 v-add-web-domain-ssl 'user1' 'domain1.fr' '/tmp/tmp.EZD7KrFjNZ'
2017-11-04 01:55:41 v-add-letsencrypt-domain 'user1' 'domain1.fr' 'domain1-fr.myserver.mycompany.net,domain1.fr,,www.domain1.fr'
2017-11-04 01:55:49 v-check-letsencrypt-domain 'user3' 'user3.org'
2017-11-04 01:55:56 v-check-letsencrypt-domain 'user3' 'user3-org.myserver.mycompany.net'
2017-11-04 01:56:02 v-check-letsencrypt-domain 'user3' 'www.user3.org'
2017-11-04 01:56:03 v-generate-ssl-cert 'user3.org' '[email protected]' 'US' 'California' 'San Francisco' 'Vesta' 'IT' 'user3-org.myserver.mycompany.net,user3.org,,www.user3.org'
2017-11-04 01:56:05 v-sign-letsencrypt-csr 'user3' 'user3.org' '/tmp/tmp.yKzT573iCc'
2017-11-04 01:56:10 v-add-letsencrypt-domain 'user3' 'user3.org' 'user3-org.myserver.mycompany.net,user3.org,,www.user3.org'
2017-11-04 01:59:00 v-delete-firewall-ban '123.183.209.139' 'SSH'
2017-11-04 01:59:45 v-add-firewall-chain 'SSH'
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Nginx stop working with failure in configuration file
I asked for nginx error log, not your vesta log.
Anyways, what exactly do you mean by " problem occurs again this night at 1:55am, on another customer account ??
If Nginx stops, it should stop the whole webserver and all sites would stop. Are you only experiencing problems with one particular user ?
It may be related to empty line being inserted / left out in snginx.conf of that user. Just open that particular file and give it a good look
Anyways, what exactly do you mean by " problem occurs again this night at 1:55am, on another customer account ??
If Nginx stops, it should stop the whole webserver and all sites would stop. Are you only experiencing problems with one particular user ?
It may be related to empty line being inserted / left out in snginx.conf of that user. Just open that particular file and give it a good look
Re: Nginx stop working with failure in configuration file
I know, I answer you a post before : http://forum.vestacp.com/viewtopic.php? ... 825#p63824mehargags wrote:I asked for nginx error log, not your vesta log.
I mean last night it was line 1 of /home/NP11/conf/web/snginx.confmehargags wrote:Anyways, what exactly do you mean by " problem occurs again this night at 1:55am, on another customer account ??
2 days ago, it was line 1 and 49 of /home/User2/conf/web/snginx.conf
After this "line deletion", nginx could not restart at all because of one config file corrupted.mehargags wrote:If Nginx stops, it should stop the whole webserver and all sites would stop. Are you only experiencing problems with one particular user ?
So to answer you clearly : no, the problem is not concerning one particular user.
And as nginx could not start, the whole webserver is down until I manualy correct the file(s)
Except this line deltion, the files are looking good.mehargags wrote:It may be related to empty line being inserted / left out in snginx.conf of that user. Just open that particular file and give it a good look
After correction, nginx is starting again...
Re: Nginx stop working with failure in configuration file
Since one week, one of my nginx config file is corrupted each day : it's missing the very first line
So each day, at 6:50am during the vesta-cp daily routine, nginx crash...
I have to manually add the missing line and restart nginx.
How can I debug this stuff ?
Code: Select all
server {
I have to manually add the missing line and restart nginx.
How can I debug this stuff ?
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Nginx stop working with failure in configuration file
Track if there is a specific cron running near that time which might be causing the problem