I’m trying to use Caddy to reverse proxy to my NextCloud server. However when I use Caddy I get the Apache2 Debian Default Page. I can get to nextcloud just fine when I type 192.168.1.21 and it takes me to 192.168.1.21/index.php/login.
This part effectively means that Caddy isn’t listening on port 80 on host 192.168.1.21, so you will need to log on to that host, stop Apache, and start Caddy.
Alright, go back to 192.168.1.21 and start up Apache again.
In short, your problem is that Apache configured to only serve Nextcloud to people requesting 192.168.1.21:
When Caddy is proxying from ncloud.skywave.com with the transparent preset enabled, though, it’s requesting ncloud.skywave.com from Apache, not 192.168.1.21.
You can either:
1. Tell Apache to listen for ncloud.skywave.com
Edit /etc/apache2/sites-available/nextcloud.conf, add a ServerAlias:
So i’ve tested both options. Head_upstream Host 192.168.1.21 option causes Caddy not to issue a cert and causes a redirect to 192.168.1.21 (which leads to nothing) when typing the domain. Transparent has no such issues and a cert gets issued no problem and Nextcloud is accessible.