Redirect from http:/[server]/nextcloud to https://[server]/nextcloud doesn't work

my nextcloud.conf reads:

Alias /nextcloud "/var/www/nextcloud/"
<Directory /var/www/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All
 <IfModule mod_dav.c>
  Dav off
 </IfModule>
 SetEnv HOME /var/www/nextcloud
 SetEnv HTTP_HOME /var/www/nextcloud
 Satisfy Any
</Directory>
<VirtualHost *:80>
   ServerName [server]
   Redirect permanent / https://[server]/
</VirtualHost>

but I can login to my nextcloud installation by http://[server]/nextcloud

what’s wrong?

Thanks in advance

Make sure that in /etc/apache2/sites-enabled/* you don’t have another <VirtualHost *:80> definition (very likely 000-default.conf)

Also ensure you have the relevant Apache modules enabled, just in case.

spot-on! Actually there was another VirtualHost *:80 set up in 000-default.conf.
Removed it and now it works!
Thanks