Page 1 of 2

NGINX not working with SSL

Posted: Sun Nov 15, 2015 7:26 am
by zebrahosting
Just setup a clean VestaCP on Ubu15. Version with only NGINX and FPM.
Created a Joomla site there and used the Joomla template. All worked fine and fast.
Then I tried to add a cert and switched on SSL. Then NGINX refuses to start.
Tried it with the 'home made' cert and with a RapidSSL but it is clearly not the Cert but the SSL function.
I have set the template from Joomla to default and back but nothing seems to bring NGINX back to live.
Switching off SSL and it runs fine. Firewall on of makes no difference either.

Any suggestions how to find the issue?

-- The result is failed.
Nov 15 12:56:24 xxxxx.hosting systemd[1]: nginx.service: Unit entered failed state.
Nov 15 12:56:24 xxxxx.hosting systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 15 12:56:24 xxxxx.hosting polkitd(authority=local)[632]: Unregistered Authentication Agent for unix-process:12391:39767588 (system bus name :1.106,
Nov 15 12:56:24 s01.zebra.hosting sudo[12390]: pam_unix(sudo:session): session closed for user root

Seems Ubuntu 15.10 uses systemd and VestCP is not handling that properly?
I also see that the STPL info is not copied into the nginx.conf properly

Re: NGINX not working with SSL

Posted: Wed Nov 18, 2015 4:03 am
by iraton
Hi

i've found the bug

Backup

/etc/nginx/conf.d/vesta.conf

Delete

Create a new vesta.conf with the following

include /home/admin/conf/web/*.conf;

Restart nginx

Re: NGINX not working with SSL

Posted: Fri Nov 27, 2015 9:20 pm
by zebrahosting
Thanks for the suggestion but it does not work for me. NGINX refused to start after I switch on SSL.

It creates the files alright but NGINX is not happy. CHecking logs after I get it back to running without SSL:
2015/11/15 10:56:14 [emerg] 60215#0: "ssl" directive is not allowed here in /home/admin/conf/web/nginx.conf:124

It seems when I switch off SSL it leaves some code in the .conf file too. Need to remove manual before I can restart.

Re: NGINX not working with SSL

Posted: Sat Nov 28, 2015 9:38 am
by Elizine
Open port 443 in your web server's firewall.

Re: NGINX not working with SSL

Posted: Sat Nov 28, 2015 11:07 am
by zebrahosting
LOL no that is not the issue.

Iraton's finding is more close. Indeed I see that the SSL .conf is not picked up correctly but I also have the NGINX server not restarting properly after setting it.

Seems not many people are running the single NGINX + PHP-FPM combination.

Re: NGINX not working with SSL

Posted: Tue Dec 01, 2015 3:49 am
by gogoi
I tried ssl with nginx as cache .. but it didn't work... I think similar issue like yours.

Pls update when you get thru :)

Thanks a lot

Re: NGINX not working with SSL

Posted: Tue Dec 01, 2015 11:53 am
by mephivio
hi vesta team,
have you test it ?
i have the same problem any fix ?
thx

Re: NGINX not working with SSL

Posted: Sat Dec 05, 2015 7:56 am
by zebrahosting
OK seems Vesta is only reacting when paid. Fair enough but is there a proper place to report bugs?

On a side note I should say I was using the Joomla template / config. Curious if the others with issues used the same or different settings.

Last night we had a site on TV and got huge amounts of visitors. The site was running Apache2 with NGINX proxy and Apache almost killed the server, switching to only NGINX dropped the load back to 50% and we had no further issues. Real reason to make this setup shine and fix the SSL bug.

Re: NGINX not working with SSL

Posted: Fri Dec 11, 2015 5:30 pm
by danimalweb
I'm having similar issues with nginx.

After enabling SSL nginx fails to restart.

Code: Select all

● nginx.service - LSB: Stop/start nginx
   Loaded: loaded (/etc/init.d/nginx)
   Active: failed (Result: exit-code) since Fri 2015-12-11 12:23:38 EST; 23s ago
  Process: 6972 ExecStop=/etc/init.d/nginx stop (code=exited, status=0/SUCCESS)
  Process: 6553 ExecReload=/etc/init.d/nginx reload (code=exited, status=0/SUCCESS)
  Process: 8808 ExecStart=/etc/init.d/nginx start (code=exited, status=1/FAILURE)

Dec 11 12:23:38 ***************.com nginx[8808]: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/conf.d/vesta.conf:5
Dec 11 12:23:38 ***************.com systemd[1]: nginx.service: control process exited, code=exited status=1
Dec 11 12:23:38 ***************.com systemd[1]: Failed to start LSB: Stop/start nginx.
Dec 11 12:23:38 ***************.com systemd[1]: Unit nginx.service entered failed state.

Re: NGINX not working with SSL

Posted: Sun Dec 13, 2015 2:32 am
by aar6on67
I have the same problem with Centos 7 and nginx + php-fpm. SSL seems to turn on but once you reboot the server or try to restart nginx it fails to start. Turning off SSL solves any issues

This is my result

Code: Select all

# service nginx start
Redirecting to /bin/systemctl start  nginx.service
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.