Appliance disable https redirect


I just installed the appliance and https was automatically enabled. How can I disable it, or just remove the redirect? I checked under apache2/sites-available and .htaccess but don’t see the option.

Thank you!

Hello @sahara.

Welcome in Nextcloud community !!

Have you tried :
a2dismod ssl
remove the line Redirect permanent \ in your config file (http).
and sudo systemctl restart apache2

Bye :slight_smile:

1 Like

Got the same Problem.
Installed the VMWare VM.
Everything is working smooth etc.
@didi44 I looked up and could not find a " Redirect permanent" in /var/www/nextcloud/config/config.php:

$CONFIG = array (
  'passwordsalt' => '*********',
  'secret' => '*********',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '',
    2 => 'nextcloud',
    3 => '*********',
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '',
  'overwrite.cli.url' => 'https://nextcloud/',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '*********',
  'dbpassword' => '*********',
  'installed' => true,
  'instanceid' => '*********',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'log.condition' =>
  array (
    'apps' =>
    array (
      0 => 'admin_audit',
  'mail_smtpmode' => 'smtp',
  'logtimezone' => 'Etc/UTC',
  'maintenance' => false,
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '*********',
  'mail_domain' => '*********',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,

As far as I can see it, The VM is based on Ubuntu…
@sahara did you find out how?

Thanks in Advance

Hello @May!

Welcome to the Nextcloud community!

It’s normal!

You have to add it in the server conf file and not in nextcloud.conf !

An example with Apache :

<VirtualHost *:80>
   Redirect permanent /

If you are using Apache, the path is /etc/apache2/sites-available/xxx.conf.

The official documentation Hardening and security guidance — Nextcloud latest Administration Manual latest documentation

Please, let me know if you have any questions.

1 Like

Thanks for the clarification,

but you stated before that the line Redirect permanent in /etc/apache2/sites-available/xxx.conf should be removed (I think you meant that).
…I found 4 .conf Files and none of them has a Redirect permanent variable :

000-default.conf, nextcloud_http_domain_self_signed.conf, default-ssl.conf, nextcloud_tls_domain_self_signed.conf.

I Uploaded them in GitHub - The-May/configdump (The code always messed up the formatting here…)

Only thing what I vaguely might think that could be doing the redirect is following in nextcloud_http_domain_self_signed.conf:

<VirtualHost *:80>
 RewriteEngine On
 RewriteRule ^(.*)$ https://%{HTTP_HOST} [R=301,L]

Any help is very appreciated.

Hi @The-May !

How did you install Nextcloud? Did you follow a tutorial? Because the files are not the same as the official documentation, but it works too :slight_smile:

Yes you can try to disable the conf with : a2dismod nextcloud_http_domain_self_signed.conf
and connect to your server in a private window.

1 Like

Like i said: I used the official VM Image with VMWare Workstation Player

Only thing I changed were Things via GUI (Apps etc) and the Trusted Domains

I will try it out today and keep you updated! Thanks in advance for the a2dismod nextcloud_http_domain_self_signed.conf command!

@didi44 it did not work unfortunately…

config was
and not
nextcloud_http_domain_self_signed.conf (my bad)

<VirtualHost *:80>

RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST} [R=301,L]

Nevertheless sudo a2dismod nextcloud_tls_domain_self_signed.conf did not work at all
ERROR: Module nextcloud_tls_domain_self_signed.conf does not exist!

Hi !

I’m sorry ! It’s my fault :slight_smile:

It’s a2dissite not a2dismod :slight_smile:

Don’t forget : sudo systemctl restart apache2

1 Like

Hi !

I downloaded Nextcloud’s VM and managed to disable https.

First of all disable all Apache configurations with a2dissite (not a2dismod :)) <ConfFile.conf>
Normally a2dissite *.conf works.

The directory /etc/apache2/site-enable/ should be empty. Check it.

You can enable the nextcloud_http_domain_self_signed.conf conf with a2ensite nextcloud_http_domain_self_signed.conf.

And edit the config.php in /var/www/nextcloud/config/config.php and comment the line : 'overwrite.cli.url' => 'https://nextcloud/',

Apply the configuration with sudo systemctl restart apache2.

Try to connect to your server from a private window and it works normally.

1 Like

First of all disable all Apache configurations with a2dissite (not a2dismod :)) <ConfFile.conf>
Normally a2dissite *.conf works.

did sudo a2dissite *.conf . :white_check_mark:

The directory /etc/apache2/site-enable/ should be empty. Check it.

ls /etc/apache2/sites-enabled gave me nothing, even did sudo, therefore empty. :white_check_mark:

You can enable the nextcloud_http_domain_self_signed.conf conf with a2ensite nextcloud_http_domain_self_signed.conf.

sudo a2ensite nextcloud_http_domain_self_signed.conf
has been run without any problems :white_check_mark:

sudo nano /var/www/nextcloud/config/config.php

commented out by adding a // :white_check_mark:


ran sudo systemctl restart apache2 without an error :white_check_mark:

Did a full sudo restart to be sure :white_check_mark:

after that I tried it out: redirects me to, leading me to an SSL Error
BUT using http://nextcloud did the trick which works fine for me though.

Merci beaucoup mon ami!

1 Like

I’m having an issue with this too. Running Nextcloud in a Turnkey Container. I tried to enable self signed cert with:

a2enmod ssl
a2ensite default-ssl
service apache2 reload

After doing this I can no longer access my Nextcloud. I just get this screen:
Gmail Screenshot by cloudHQ 3_23_2021 6_02_59 AM

I’ve tried with http, https, my local ip and my dns name. Used to work with both my ip and dns name.
I followed all your steps to try to get it back. Do you have any suggestions for me to try?

Hi !

a2dismod ssl
a2dissite default-ssl
service apache2 reload

It doesn’t work?