Page 2 of 2

Re: NGINX not working with SSL

Posted: Tue Dec 15, 2015 2:23 am
by aar6on67
I believe I found the problem at least for me in my case. I can now get nginx to start. I have not tested with a live domain with ssl.

Iraton was correct but didn't point out what was the original problem. It is helpful to beginners to learn what went wrong than to blindly cut paste code found on the internet.

My new install vestacp has this bug when enabling SSL. Two very minor errors were in the following file.

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

Below is now the correct code:

Code: Select all

include /home/admin/conf/web/nginx.conf;
include /home/admin/conf/web/snginx.conf;
My second line had the "i" in"include" capitalized AND lacked the end semicolon. Can anyone else confirm?

@zebrahosting correct me if i'm wrong but /home/admin/conf/web/nginx.conf should never have any SSL code in it. that is what snginx.conf is for.

Re: NGINX not working with SSL

Posted: Tue Dec 15, 2015 7:48 am
by zebrahosting
My vesta.conf file has no errors. (Using the Ubuntu version)
It clearly does not add the right code in the right place when enabling SSH. NGINX is than not able to start. The reverse is also true. When disabling SSH afterwards, I manual remove the SSH line to get it back to working.
I noticed that there was a bug report somewhere so lets hope it gets fixed soon.

Re: NGINX not working with SSL

Posted: Sat Jan 09, 2016 6:32 pm
by grenadecx
The problem still exist and the reason as some people have pointed out is because it adds the Apache line to the Nginx configuration instead of detecting the webserver and use right configuration.

To solve this, edit the following file: /usr/local/vesta/bin/v-add-web-domain-ssl starting at line 93 to 97

Code: Select all

# Checking web config
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
if [ -z "$(grep "$conf" $web_conf)" ]; then
   echo "Include $conf" >> $web_conf
fi
Delete those rows or comment them out and add instead

Code: Select all

# Checking web config include
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
web_include=$(grep "$conf" $web_conf )
if [ -z "$web_include" ] && [ "$WEB_SYSTEM" != 'nginx' ]; then
    echo "Include $conf" >> $web_conf
fi
if [ -z "$web_include" ] && [ "$WEB_SYSTEM" = 'nginx' ]; then
    echo "include $conf;" >> $web_conf
fi
For anyone wondering, these lines are drafted from the file /usr/local/vesta/bin/v-add-web-domain as starting from line 172 to 180.

I'm not sure where to file the fix for it, so here it is anyways.

Re: NGINX not working with SSL

Posted: Sat Feb 13, 2016 7:54 pm
by Soulstice
Hey if anyone needs a How-To in the future to fix the SSL bug here is a link(youtube) for installing Vesta CP successfully.
The video covers the bug and more, but if you just want a quick fix go to the text tutorial.

Text Tutorial: http://discuss.soulstice.ca/t/install-v ... l-panel/28

Youtube Tutorial:https://www.youtube.com/watch?v=0DNeoATr0Og

Re: NGINX not working with SSL

Posted: Mon Jun 20, 2016 11:29 am
by drsdre
grenadecx thanks for the fix!

I took the liberty of transforming your fix in a pull request: https://github.com/serghey-rodin/vesta/pull/701