Ran into a small problem though. We’re running:
Apache version 2.4.39
Linux 7.6 kvm
PHP 7.2
NextCloud 16.0.1
Our site is setup using .htaccess to redirect everything to HTTPS. For example if a user types in: mydomain.com/Art/myFiles
it is automatically redirected to https://mydomain.com/Art/myFiles
but if we type in myDomain/NextCloud
it is redirected to myDomain/NextCloud/index.php/login
without the https.
Of course this gives the onscreen “This connection is not secure…” and the unlocked padlock in the address bar.
As everything else works with our https redirect, is there something in the NextCloud config that we can change to have it always redirect to the https?
ummm. pls remove at least the ‘secret’ and ‘dbpassword’ - values from your entry. expect them to have become open now and change them.
anyways: thanks for posting the config… i can’'t see anything here neither. but i am no master in it.
would you be so kind and post parts of your nextcloud.log as well? maybe it’ll show some errormessages which might be of help in this case.
@JimmyKater
Thanks for the advice, this is just a test install with temp users & passwords. I figure after a week of playing with it, things will be so messed up that I will need to do another install
As for nextcloud.log, I couldn’t find one. I poked through the directories, but nothing. Where should I find the log?
Cheers
Are you using the Apache2 mod_rewrite ?
In your /etc/apache2/sites-available/vhost.conf you should have the following
RewriteEngine on
RewriteCond %{SERVER_NAME} =nextcloud.your.tld
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
This is smarter, faster than having to deal with htaccess
@stratege1401
Thanks for chirping in, however this is Greek to me!! Linux servers are not my forte - by any stretch.
I’ll need to check with our hosting provider to follow up on the vhost.conf file.
It is really strange to me too. FInally when I thought I figured out how to carefully craft the https redirect using .htaccess the whole thing is becoming a hair-puller!
I’ll keep poking and let you know what I come up with.
Cheers
The excellent tech support from the folks at ChemiCloud hosting, poked and prodded and found the problem.
In this case the .htaccess rewrite needed to be in the Nextcloud installation folder, not at the public_html level. Although all other subdirectory redirect works with the rewrite code in the public_html .htaccess file, Nextcloud needs it to be in the Nextcloud installation directory.
Thanks to everyone that pitched in on this.
Cheers