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

NGINX not working with SSL

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
15 posts
  • Previous
  • 1
  • 2
aar6on67
Posts: 2
Joined: Sun Dec 13, 2015 2:26 am

Re: NGINX not working with SSL
  • Quote

Post by aar6on67 » Tue Dec 15, 2015 2:23 am

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.
Top

zebrahosting
Posts: 7
Joined: Sun Nov 15, 2015 7:21 am

Re: NGINX not working with SSL
  • Quote

Post by zebrahosting » Tue Dec 15, 2015 7:48 am

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.
Top

grenadecx
Posts: 17
Joined: Sat Jan 09, 2016 6:23 pm

Re: NGINX not working with SSL
  • Quote

Post by grenadecx » Sat Jan 09, 2016 6:32 pm

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.
Top

Soulstice
Posts: 1
Joined: Sat Feb 13, 2016 7:50 pm

Re: NGINX not working with SSL
  • Quote

Post by Soulstice » Sat Feb 13, 2016 7:54 pm

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
Top

drsdre
Posts: 12
Joined: Fri May 08, 2015 8:49 am

Re: NGINX not working with SSL
  • Quote

Post by drsdre » Mon Jun 20, 2016 11:29 am

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
Top


Post Reply
  • Print view

15 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