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

How do I redirect all traffic to the https:// domain?

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
Spythe
Posts: 9
Joined: Wed Jun 21, 2017 7:15 pm

How do I redirect all traffic to the https:// domain?
  • Quote

Post by Spythe » Thu Jun 22, 2017 10:18 am

Hey guys,

I've setup Vesta and added SSL support for all domains with Let's Encrypt. When manually typing https://domain.com it'll show the site with SSL turned on, but when I just type domain.com it'll always navigate to the non-SSL http:// variant.

How do I make all traffic, per domain or all domains all together (since all domains will have SSL) go automatically to https://domain.com ?

I already googled and saw lots of suggestions, including server {} blocks, which I pasted within the http {} part in the /etc/nginx/nginx.conf file and restarted the server, but that didn't change a thing..
Top

shanjie
Posts: 37
Joined: Thu Jan 14, 2016 12:02 pm

Re: How do I redirect all traffic to the https:// domain?
  • Quote

Post by shanjie » Fri Jun 23, 2017 12:44 am

https://vestacp.com/docs/#how-to-force-https
Top

castris
Posts: 4
Joined: Tue Feb 18, 2020 7:43 am

Os: Ubuntu 18x
Web: nginx + php-fpm
Re: How do I redirect all traffic to the https:// domain?
  • Quote

Post by castris » Thu Dec 31, 2020 11:56 am

Post is older but doc is actual.
How to force https/SSL on a domain
1. Install custom nginx template

Code: Select all

cd /usr/local/vesta/data/templates/web
wget http://c.vestacp.com/0.9.8/rhel/force-https/nginx.tar.gz
tar -xzvf nginx.tar.gz
rm -f nginx.tar.gz
3. Create new package or set force-https as nginx template in the existing package
4. Add new user and assing him package with force-https template
5. Add new domain with SSL certificate and check the result
Well...

After step 2, there're in /usr/local/vesta/data/templates/web/nginx/ two new files, force-https.stpl and force-https.tpl

Step 3 create a package or force-https no work using any template named force-https

Any template named force-htpps on VestaCP interface, in new template or on domain for apply new template.

What is wrong?




I'm using vestaCp 0.9.8 Release 26
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

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