Page 1 of 1

Configure SSL to public_shtml or public_html

Posted: Tue Feb 02, 2016 12:30 pm
by edica
Hello,

Install and configure SSL to public_shtml but still the site is going to public_html.
Image

Can I use public_html, has some difference?

Thanks.

Re: Configure SSL to public_shtml or public_html

Posted: Tue Feb 02, 2016 2:25 pm
by skurudo
Seems like bug to me...

Yes, you can use separetely public_shtml and public_html. I don't know, when this thing broken - we try to check this, but you can make a little changes in /home/user/conf/web/sapache2.conf

DocumentRoot
Directory

public_html -> public_shtml

Re: Configure SSL to public_shtml or public_html

Posted: Tue Feb 02, 2016 4:33 pm
by edica
Strange, was public_html. All fixed. Sorry.

Taking advantage, I can do so:
To go straight to the snginx.conf

/home/user/conf/web/nginx.conf:

server {
listen 000.000.000.000:80;
server_name mydomain.com www.mydomain.com;
#force https and www
return 301 https://www.mydomain.com$request_uri;
...

Re: Configure SSL to public_shtml or public_html

Posted: Tue Feb 02, 2016 8:43 pm
by skurudo
https://vestacp.com/docs/#how-to-force-https
Use this template to redirect, it's simple and no manually jobs with template.
Better use templates, if sometime somebody make rebuild no config changes will lost.

Re: Configure SSL to public_shtml or public_html

Posted: Wed Feb 03, 2016 12:59 pm
by edica
Beautiful very good.

To force www can put in nginx.conf?
rewrite ^(.*) https://www.mydomain.com.br$1 permanent;

Thank you so much.

Re: Configure SSL to public_shtml or public_html

Posted: Wed Feb 03, 2016 1:27 pm
by skurudo
edica wrote: To force www can put in nginx.conf?
rewrite ^(.*) https://www.mydomain.com.br$1 permanent;
Yeah, but a much better place - template.
If you'll make Rebuild Web in future, you don't lose this addition.

Re: Configure SSL to public_shtml or public_html

Posted: Wed Feb 03, 2016 4:20 pm
by edica
Yes I installed template for nginx force-https. Very good.

But in force-https.tpl:

server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
location / {
rewrite ^(.*) https://www.%domain_idn%$1 permanent;
}
}

And if I put “www.”. The problem?

Thanks.