Change from http to https


I hade my nextcloud in my local lan with http.

I wished to change it to https
and found a doc there:

vi /etc/apache2/sites-available/nextcloud.conf
<VirtualHost *:80>
Redirect permanent /

<VirtualHost *:443>

Header always set Strict-Transport-Security “max-age=15552000; includeSubDomains”

TransferLog /var/log/apache2/nextcloud_access.log
ErrorLog /var/log/apache2/nextcloud_error.log

and done a

/etc/init.d/apache2 restart

the problem i don’t have access to the site any more

have a nice day


  1. Did you enable SSL in your apache-settings?
  2. Does the page open if you try
  3. is already accessable from extern, or better…do you get requests in your apache`s access-logfile when you try to open the page?
  4. What shows your logfiles in general?

At first, try to change:

  • Redirect permanent / to Redirect permanent /
  • Check apache config (“apachectl -t” or “apachectl configtest”), if it says “Syntak OK”, then “apachectl restart” and check if page opens

if you opened the page via ip-address until now, you won’t have access anymore because every request will be redirected to the URL, which (can be) isnt accessable by now. With the example above (changing Redirect-URL), you can test if the call would from http -> https would work with ip-address. if that doesnt work, check your logfiles.

You can also download certbot auto and it will take care of redirecting to https

certbot: error: unrecognized arguments: auto

@Humbug1, thanks for your feedback
on the page i got a

apachectl i got a config OK

i did worte down what i did there:

i have to find out why this happen

in the log files
/var/log/apache2/nextcloud_access.log - - [29/Oct/2018:22:21:00 +0100] “\x16\x03\x01\x02” 400 305 - - [29/Oct/2018:22:21:00 +0100] “\x16\x03\x01\x02” 400 305 - - [29/Oct/2018:22:21:00 +0100] “\x16\x03\x01\x02” 400 305 - - [29/Oct/2018:22:21:00 +0100] “\x16\x03\x01” 400 305

[Mon Oct 29 22:11:57.952862 2018] [mpm_prefork:notice] [pid 5497] AH00163: Apache/2.4.25 (Debian) OpenSSL/1.0.2l configured – resuming normal operations
[Mon Oct 29 22:11:57.952929 2018] [core:notice] [pid 5497] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Oct 29 22:14:47.577587 2018] [mpm_prefork:notice] [pid 5497] AH00169: caught SIGTERM, shutting down
[Mon Oct 29 22:14:47.676217 2018] [mpm_prefork:notice] [pid 5586] AH00163: Apache/2.4.25 (Debian) OpenSSL/1.0.2l configured – resuming normal operations
[Mon Oct 29 22:14:47.676272 2018] [core:notice] [pid 5586] AH00094: Command line: ‘/usr/sbin/apache2’