I am stuck as to how to forward the connection to https on load, instead of by path.

This is how it could be done via the htaccess:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

But since that method forwards all the sites in that platform to https, that is not what is wanted. Any help would be great. Thanks for a great hosting solution.

Comments

bmx269’s picture

I found a rule like this :
server {
listen 80;
listen [::]:80;
listen 443 default ssl;

server_name www.example.com;

ssl_certificate /path/to/my/cert;
ssl_certificate_key /path/to/my/key;

if ($ssl_protocol = "") {
rewrite ^ https://$server_name$request_uri? permanent;
}
}

Would this be what I need? and where would I put this on BOA? Would the SSL instructions have a switch that can be added to do this?

omega8cc’s picture

Please use this SSL how-to: http://drupalcode.org/project/barracuda.git/blob/HEAD:/docs/SSL.txt

Then create separate server{} block with domain in question in the server_name line instead of _ wildcard and add one line after access_log directive:

rewrite ^ https://domain.name/$request_uri? permanent;

This needs to be added in the "Plain HTTP proxy" part.

Note that this how-to requires separate IP for this domain, because it is a local proxy.

Or you could enable Aegir standard SSL feature if you have only one IP and enable forced redirect to HTTPS there.

bmx269’s picture

Thanks

omega8cc’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nrsimha’s picture

Status: Closed (fixed) » Active

Some time ago I could use on BOA settings in Aegir to automatically redirect to https://, is it still possible to use Aegir interface?

If not, to which file I should add rewrite ^ https://domain.name/$request_uri? permanent; ?

There is file for specific site '/data/disk/o1/config/server_master/nginx/vhost.d/domain.name', is somehow possible to set https:// as default there?

omega8cc’s picture

Status: Active » Closed (fixed)

@nrsimha

Your question is already answered above.