I got a problem which I have been trying to fix for a few days now and I don\'t know what to do, have been looking for answers but all of those I found didn\'t help me.
Try set a user in nginx.conf, maybe that's why he can not start the service:
User www-data;
Just write this your work get done
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx restart
systemctl status nginx
Happy Learning
Check df -h if you are under centOS system
$ ps ax | grep nginx<br>
$ kill -9 PIDs
$ service nginx start
or set back /etc/nginx/sites-available/default
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
try :
sudo service nginx restart
In my case, it's because of apache server is running somehow. So I stop apache then restart nginx. Work like a charm!
sudo /etc/init.d/apache2 stop
sudo systemctl restart nginx