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

http2.tpl file to force https

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
edica
Posts: 126
Joined: Tue May 26, 2015 7:31 pm

http2.tpl file to force https
  • Quote

Post by edica » Fri Apr 12, 2019 1:29 pm

Hi,

I changed the http2.tpl file to force https. But it does not go to https. what's wrong?

server {
listen %ip%:%proxy_ssl_port% http2;
server_name %domain_idn% %alias_idn%;

location / {
return 301 https://%domain%$request_uri;
}

include %home%/%user%/conf/web/snginx.%domain%.conf*;

}
Top

dreiggy
Posts: 154
Joined: Thu May 17, 2018 8:05 pm
Contact:
Contact dreiggy
Skype

Os: CentOS 6x
Web: apache + nginx
Re: http2.tpl file to force https
  • Quote

Post by dreiggy » Thu Apr 18, 2019 9:06 pm

I don't works for existing domains or for new one?

Mhmm maybe try change like this:

location / {
return 301 https://%domain_idn%$request_uri;
}

PS. After template change, you need to rebuild vhosts:

Code: Select all

for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done
Top

grayfolk
Support team
Posts: 1111
Joined: Tue Jul 30, 2013 10:18 pm
Contact:
Contact grayfolk
Website Facebook Skype Twitter

Os: CentOS 6x
Web: nginx + php-fpm
Re: http2.tpl file to force https
  • Quote

Post by grayfolk » Fri Apr 19, 2019 10:30 pm

edica wrote: ↑
Fri Apr 12, 2019 1:29 pm
Hi,

I changed the http2.tpl file to force https. But it does not go to https. what's wrong?

server {
listen %ip%:%proxy_ssl_port% http2;
server_name %domain_idn% %alias_idn%;

location / {
return 301 https://%domain%$request_uri;
}

include %home%/%user%/conf/web/snginx.%domain%.conf*;

}

Code: Select all

server {
    listen      %ip%:%proxy_port%;
    server_name %domain_idn% %alias_idn%;

    location / {
        return 301 https://%domain_idn%$request_uri;
    }

        include %home%/%user%/conf/web/snginx.%domain%.conf*;

}
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