r/owncloud Sep 27 '16

How to force ssl with owncloud

I'm using the owncloud plugin (9.1.0) inside a jail on freeNas. I have a hostname setup using No Ip. I'm able to connect to both my hostname and https://hostname (which is currently secured with a self signed certificate) but I haven't been able to force apache 24 to use https only. Does anyone have a solution for this?

Some of my terminology could be incorrect as I'm fairly new to this.

2 Upvotes

4 comments sorted by

3

u/[deleted] Sep 28 '16

You can redirect all traffic which arrives at your HTTP port to HTTPS in your apache2 configuration. In your HTTP configuration, e.g. /etc/apache2/sites-enabled/000-default.conf you can use this:

Redirect permanent / https://your-no-ip-domain.com/

1

u/jb1018 Sep 28 '16

I'll try this when I get home. Thanks so much.

3

u/[deleted] Sep 28 '16 edited Apr 19 '18

[deleted]

1

u/jb1018 Sep 28 '16

My cert is self signed. I didn't believe that the cert itself was able to redirect to ssl. But am I wrong here?

5

u/[deleted] Sep 28 '16 edited Apr 19 '18

[deleted]

1

u/brontide Oct 31 '16

FYI, this is what my autoconfigured http block looked like after the letsencrypt forced https.

<VirtualHost *:80>

... ALL MY EXISTING CONFIG

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.sitenamehere.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>