Nginx not running with no error message

前端 未结 8 1141
深忆病人
深忆病人 2021-01-30 06:15

I am trying to start my nginx server. When I type \"$> /etc/init.d/nginx start\", I have a message appearing \"Starting nginx:\", and then nothing happens. There is no error mes

相关标签:
8条回答
  • 2021-01-30 06:50

    Check the daemon option in nginx.conf file. It has to be ON. Or you can simply rip out this line from config file. This option is fully described here http://nginx.org/en/docs/ngx_core_module.html#daemon

    0 讨论(0)
  • 2021-01-30 06:52

    You should probably check for errors in /var/log/nginx/error.log.

    In my case I did no add the port for ipv6. You should also do this (in case you are running nginx on a port other than 80): listen [::]:8000 default_server ipv6only=on;

    0 讨论(0)
  • 2021-01-30 06:53

    One case you check that nginx hold on 80 number port in system by default , check if you have any server like as apache or anything exist on system that block 80 number port thats the problem occurred.

    1 .You change port number on nginx by this way,

    sudo vim /etc/nginx/sites-available/default

    Change 80 to 81 or anything,

    1. Check everything is ok by ,

    sudo nginx -t

    1. Restart server

    sudo service nginx start

    1. Check the status of nginx:

    sudo service nginx status

    Hope that will work

    0 讨论(0)
  • 2021-01-30 06:53

    I had the exact same problem with my instance. My problem was that I forgot to allow port 80 access to the server. Maybe that's your issue as well?

    Check with your WHM and make sure that port is open for the IP address of your site,

    0 讨论(0)
  • 2021-01-30 06:54

    In your /etc/nginx/nginx.conf file you have:

    include /etc/nginx/site-enabled/*;
    

    And probably the path you are using is:

    /etc/nginx/sites-enabled/default
    

    Notice the missing s in site.

    0 讨论(0)
  • 2021-01-30 07:03

    First, always sudo nginx -t to verify your config files are good.

    I ran into the same problem. The reason I had the issue was twofold. First, I had accidentally copied a log file into my site-enabled folder. I deleted the log file and made sure that all the files in sites-enabled were proper nginx site configs. I also noticed two of my virtual hosts were listening for the same domain. So I made sure that each of my virtual hosts had unique domain names.

    sudo service nginx restart

    Then it worked.

    0 讨论(0)
提交回复
热议问题