Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

[SOLVED]Sites not avaible after reboot (nginx failed to start)

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
17 posts
  • Previous
  • 1
  • 2
mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Sites not avaible after reboot
  • Quote

Post by mehargags » Sat Dec 30, 2017 8:38 am

You need to run nginx -t when your nginx has failed to start. That is when you will find the cause of the problem
Top

Holiday
Posts: 11
Joined: Wed Nov 15, 2017 10:02 am

Re: Sites not avaible after reboot
  • Quote

Post by Holiday » Sat Dec 30, 2017 8:56 am

Ok,

I've restarted the server, the error occured, i did the nginx -t and this is the message

Code: Select all

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
And still have this message in /var/log/nginx/error.log from the hour of the restart :

Code: Select all

2017/12/30 09:53:27 [emerg] 2122#2122: bind() to 163.XXX.XXX.59:80 failed (99: Cannot assign requested address)
Top

imperio
VestaCP Team
Posts: 7000
Joined: Sat Dec 01, 2012 12:37 pm
Contact:
Contact imperio
Website

Re: Sites not avaible after reboot
  • Quote

Post by imperio » Sat Dec 30, 2017 9:40 am

Try to this

Code: Select all

killall nginx
service nginx start
Top

Holiday
Posts: 11
Joined: Wed Nov 15, 2017 10:02 am

Re: Sites not avaible after reboot
  • Quote

Post by Holiday » Sat Dec 30, 2017 10:58 am

@imperio

I just tried it and nginx starts succesfully after being killed. I even tried "nginx -t" after killing it (and still configuration ok).
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Sites not avaible after reboot
  • Quote

Post by mehargags » Sat Dec 30, 2017 1:49 pm

When you reboot the server what exactly happens :
1. Nginx doesn't start... does it start when you manually do service nginx restart
or
2. it starts only when you kill the procoesses as Imperio mentioned ?

I suspect Nginx is not able to bind itself to your IP at startup. May be something in your network config or some service is using port 80 at startup. (then releases it after a few minutes because you say

resrearch and read your error : https://www.google.com/search?q=nginx+error%3A+(99%3A+Cannot+assign+requested+address
Top

Holiday
Posts: 11
Joined: Wed Nov 15, 2017 10:02 am

Re: Sites not avaible after reboot
  • Quote

Post by Holiday » Sat Dec 30, 2017 2:06 pm

Yes when i reboot the server, nginx doesn't start but if i manually start it (with "service nginx start") it starts and run perfectly (without killing it first).

I thought i would ask vesta forum before doing my research, since i thought it was vesta related, but i'll have to look over the web and do some tests.

EDIT: I actually did research meanwhile but it's hard to find something because it only happens while booting. After no problem. Majority of the posts talks about ip changes and my ip didn't changed. Moreover i can start nginx manually. So if you have any idea it will be welcome :\

EDIT 2 : This is the working solution : https://stackoverflow.com/questions/204 ... 6#20532666

Thanks for your time
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: [SOLVED]Sites not avaible after reboot (nginx failed to start)
  • Quote

Post by mehargags » Sun Dec 31, 2017 1:16 pm

As I already said, it had something to do with your network config... the IP is not available for Nginx to bind. Congratulations on resolving your issue, feel proud and always research your way through the forums to learn more.

If you need any more help, we are always here.
Happy New Year
Top


Post Reply
  • Print view

17 posts
  • Previous
  • 1
  • 2

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password