We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to force SSL for one domain?
How to force SSL for one domain?
How to force SSL for one domain?
Re: How to force SSL for one domain?
There is two ways:
1 - templates - need to change - https://vestacp.com/docs/#how-to-force-https
or
2 - some change in domain nginx conf file
1 - templates - need to change - https://vestacp.com/docs/#how-to-force-https
or
2 - some change in domain nginx conf file
Re: How to force SSL for one domain?
Thanks. This worked perfectly.
What code of line should I add to the template to make all www-requests redirect to non-www as well?
What code of line should I add to the template to make all www-requests redirect to non-www as well?
Re: How to force SSL for one domain?
There is simple way:mark wrote:What code of line should I add to the template to make all www-requests redirect to non-www as well?
Code: Select all
if ($http_host != "www.domain.ru") {
rewrite ^ http://domain.ru$request_uri permanent;
}
Re: How to force SSL for one domain?
using if - bad way
use
if using SSL
use
Code: Select all
server {
listen 80;
server_name example.com;
return 301 http://www.example.com$request_uri;
}
server {
listen 80;
server_name www.example.com;
...
}
Code: Select all
server {
listen 80;
listen 443 ssl;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
listen 80;
listen 443 ssl;
server_name example.com;
# rest goes here...
}
Re: How to force SSL for one domain?
Omg ) I was too sleepy to write about second way.DFS wrote:using if - bad way
Yep, I know about "IF is Evil" - http://wiki.nginx.org/IfIsEvil
But in non-highload projects with configs less than 1k domains it's faster/simple and secure to use.
Thanks DFS, need to tell about ideologically correct things too )
Re: How to force SSL for one domain?
Hi,
I am having huge issues to run SSL.
I just have a WEB in vestacp.
In the public_html folder I run a wordpress secured with BulletProof Security. I get some hints from there also, thexy say I must add this code to the .htaccess.
So, in that public_html folder also a WHMCS instlalation runs which I later want to have SSL running on too. In this it doesnt work also.
I always get "Page is unavailable":
I thought that I just take the SSL cert from my provider (I have them create all necessary files)
then add it it to the correct boxes in vestacp, there I get a green "changes are saved" and fine.
But because both systems are not working to use SSL, wordpress and WHMCS, I either cannot test anything with sslshopper also and I am really concerned about why it is not working...
Do I have to make it like in the link shown above https://vestacp.com/docs/#how-to-force-https ? never worked with nginx...
Please anybody help soon.
My nerves...
Cheers.
Andre
EDIT: HAHAHA, that was it...
I just followed the instructions and on the WEB I changed the Ngnx template to the new one.. Then it works...
I am having huge issues to run SSL.
I just have a WEB in vestacp.
In the public_html folder I run a wordpress secured with BulletProof Security. I get some hints from there also, thexy say I must add this code to the .htaccess.
Code: Select all
# WP REWRITE LOOP START
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{SERVER_PORT} ^80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteRule ^index\.php$ - [L]
I always get "Page is unavailable":
I thought that I just take the SSL cert from my provider (I have them create all necessary files)
then add it it to the correct boxes in vestacp, there I get a green "changes are saved" and fine.
But because both systems are not working to use SSL, wordpress and WHMCS, I either cannot test anything with sslshopper also and I am really concerned about why it is not working...
Do I have to make it like in the link shown above https://vestacp.com/docs/#how-to-force-https ? never worked with nginx...
Please anybody help soon.
My nerves...
Cheers.
Andre
EDIT: HAHAHA, that was it...
I just followed the instructions and on the WEB I changed the Ngnx template to the new one.. Then it works...
Re: How to force SSL for one domain?
Well done, man! ^_^webass wrote:EDIT: HAHAHA, that was it...I just followed the instructions and on the WEB I changed the Ngnx template to the new one.. Then it works...
Re: How to force SSL for one domain?
Hi skurudo,
My website is bitpow.co and i've an issue on my VestaCP about force ssl.
I've follow instruction from this link: https://vestacp.com/docs/#how-to-force-https, i've change the proxy template to force-https but the web just loading and then shown this: The page isn't redirecting properly
Error log shown nothing. What should the configuration must be checking?
Thanks
My website is bitpow.co and i've an issue on my VestaCP about force ssl.
I've follow instruction from this link: https://vestacp.com/docs/#how-to-force-https, i've change the proxy template to force-https but the web just loading and then shown this: The page isn't redirecting properly
Error log shown nothing. What should the configuration must be checking?
Thanks
Re: How to force SSL for one domain?
You use some tricky htaccess or php with routing?linboxs wrote: I've follow instruction from this link: https://vestacp.com/docs/#how-to-force-https, i've change the proxy template to force-https but the web just loading and then shown this: The page isn't redirecting properly