Page 1 of 1

Nginx fails to restart after enabling SSL Support; Site goes down

Posted: Wed Nov 02, 2016 7:09 pm
by rajbdilip
After Enabling SSL Support and entering required keys, and then hitting Save, the settings get saved but the site goes down and nginx fails to restart.

Nginx error log gives the following:

Code: Select all

2016/11/02 18:59:29 [emerg] 8687#8687: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:29 [emerg] 8687#8687: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:29 [emerg] 8687#8687: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:29 [emerg] 8687#8687: still could not bind()
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: still could not bind()
BUT if I reboot the server, Nginx starts up and I can access the site with both 'http' and with 'https' but I get 500 Internal Server on the page and 502 Bad Gateway in browser console. This error goes away if I disable the SSL support from VestaCP panel and reboot the server.

For your consideration:

nginx version: nginx/1.10.2
vesta - core package Version:0.9.8 (amd64) Release:16

Re: Nginx fails to restart after enabling SSL Support; Site goes down

Posted: Sun Nov 06, 2016 8:56 am
by rajbdilip
After rebooting the server, when it gives 500 Internal Server error, netstat -tuapen | grep 443 gives:

Code: Select all

tcp        0      0 104.131.90.2:443        0.0.0.0:*               LISTEN      0          22290       4453/nginx.conf
It looks nginx itself is listening to the port. What could be causing 502? I had done clean Nginx + Apache install and haven't messed up with any nginx or apache configuration.

Re: Nginx fails to restart after enabling SSL Support; Site goes down

Posted: Sat Dec 17, 2016 8:08 pm
by h2p
What do you think about?

Re: Nginx fails to restart after enabling SSL Support; Site goes down

Posted: Thu Jan 19, 2017 9:03 pm
by cboursinos
Same error! You found solution?

Re: Nginx fails to restart after enabling SSL Support; Site goes down

Posted: Sat Jan 21, 2017 1:51 am
by noogen
Can you post all your nginx confs?
/home/*/conf/web/nginx.conf
/home/*/conf/web/snginx.conf
/home/*/conf/web/nginx.*.conf_letsencrypt

Re: Nginx fails to restart after enabling SSL Support; Site goes down

Posted: Tue Jan 24, 2017 3:07 pm
by rajbdilip
I did a fresh install and it worked. Perhaps letsencrypt messed up some config.