Report this

What is the reason for this report?

My nginx is stopping by itself, several times a day!

Posted on December 25, 2016

My nginx is stopping by itself, several times a day!

Hello guys. I am in a tightening, I am in trouble, time and other my sites are offline, when I go to check my nginx server is stopped, I call again, when it is a few hours later, the time varies a lot, it again, I have to send one <Service nginx start> and this is a vice that lasts almost a month. I’ve been analyzing, there is no precise time, so it’s not a crazy cron, people what do I do? I use ubuntu 16.04 / 32 + virtualmin + nginx + php7.0-fpm + mysql 5.7. I did not do anything on the server by the time he started it !! It is not about load, because I have little access and a lot of resources left over, I worked a lot configuring this and suddenly about 2 months later after I finished configuring everything, the server starts that this crazy behavior : '(



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.

You say it’s not about lot, you configured it but however, I would still look at syslog to verify it.

Behavior you explained is usually due to running out of memory. Even with everything well configured and not under load it can happen if you use small Droplet.

Open syslog with your favorite text editor:

  1. sudo nano /var/log/syslog

Find nginx (if it makes problem) and look for Out of Memory, OOM, OOM-killer entries. If you find any, that means you are running out of memory and that you need to upgrade.

You have two options:

  1. upgrade Droplet
  2. and free variant - add Swap space to your Droplet.

those “lot of configuring” might left some bad configuration. did you checked the error log after it turned off by the way? you might find whats the main reason of turning it down from there.

Thanks for reply :-)

I’ve been looking at the nginx logs in /etc/nginx/error.log> nano and noticed that the service is complaining about a duplicate config in a determinate line:

2016/12/25 10:02:00 [warn] 7454 # 7454: duplicate MIME type “text / html” in /etc/nginx/nginx.conf:57

And on this line I see this:

Gzip_types text / plain application / x-javascript text / css application / javascript text / javascript application / xml + rss text / xml text / html application / json application / vnd.ms-fontobject application / Font-truetype application / x-font-ttf TEXT / HTML application / xml font / eot font / opentype font / otf image / svg + xml image / vnd.microsoft.icon; Gzip_disable “MSIE [1-6] .”;

True that the chance to have a nonsense in the middle is great, because I never leave anything in stock, I always give an adornment in the directrives of my services, fail2ban, firewall, knocking, everything full of the fails, soon chance of giving poop is bigger too , But all for safety and low machine performance.

But I did not want to be config, because I have an apache server with ubuntu 14 in stock, that’s a good nut, I just installed it, without moving or installing anything, just installed virtualmin in an opendkim package and already put a vhost in it through a restore , And is giving even a bug to stop apache and with the problem of being mysql when not apache.

Then I removed what it said to be duplicity: text / html Then restart the server and no longer adding a new line in the log as it was rule to say it was duplicated, well, but the service always started, with no errors printed on my console.

I do not think there’s a relationship. I just made the reset and wait now to see if it continues in the madness, I’m thinking it’s something virtualmin, because I have apache on another server, which is almost the same, and worse, stopping msql together. When website crashes, abou the dashboard of virtualmin, spying the services status tab, and it is, or apache, or mysql stopped. Now on that other server, with nginx, it’s direct, all the time. Almost 6 times a day nginx has the service stopped, and having to start tight player of the virtualmin and does not roll, so I do by the terminal happens, so that e’algo in that panel: / ¬¬ 'already filled in the offical forum of them this dawn And waiting for feedback.

So my myqsl is also stopping, so I accessed the logs, and they are all empties !! And my server fully stocked, with no improvement in the settings, are with mysql stopping several times a day, so I noticed that my exfoliation of not having nor creating swap memory could be the problem, and max_connection in my.cnf I increased from 30 to 300.

Let’s see if it still stops those services.

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.