Hi @clendee, sorry I’m late to the party, it’s that time of year!
I’ve put a permanent redirect in my Apache 2.4.29 so all http traffic is converted to https. Nothing is ever transmitted clear:
<VirtualHost *:80>
ServerName cloud.darksteve.tk
Redirect permanent / https://cloud.darksteve.tk/
</VirtualHost>
<VirtualHost *:443>
# DocumentRoot /usr/local/www/owncloud
DocumentRoot /usr/local/www/nextcloud
ServerName cloud.darksteve.tk
Header always set Strict-Transport-Security "max-age=15768000"
SSLEngine on
SSLCertificateFile <redacted>.pem
SSLCertificateKeyFile <redacted>.pem
</VirtualHost>
This works perfectly for me. Of course, your issue might be caused by DNS. I used to have this issue when I was still learning and I first set up a home server in 2004. This will take a moment to write clearly.
When you access your site externally, DNS directs you to your real-world IP address (e.g. 1.2.3.4). Your router is configured to forward ports 80 and 443, so your request connects straight through to your server’s internal IP (e.g. 192.168.1.1).
When you access your site internally, DNS still directs you to your real-world IP address (your router), but you’re already internal so port forwarding won’t work, and you get an error.
It took me way longer than it should have to figure out back in 2004, but once I realised, it was kind of obvious. You can get around this by adding a line to your desktop/laptop’s hostfile, but then the device won’t connect externally and it’s hard to change a phone’s hosts file anyway.
I started running my own internal DNS and DHCP servers. My internal DCHP server provides only my internal DNS, which directs me to 192.168.1.1, but once I’m external, the external DHCP will assign you an external DNS that will direct you to your real-world IP of 1.2.3.4.
This has added benefits of allowing you to blocks ads/malware for the house, and also allows you to get around ISP blocks (e.g. here in Australia, TPB and other sites are blocked via DNS).
I hope this helps, sorry I was late!