I have a Raspberry Pi serving a couple of static websites through Apache and doing some other stuff.
Now I’ve been gifted another Raspberry, so I installed NextCloudPi on it, and I would like to redirect a new subdomain (something like cloud.domain.com) from the first Raspberry to the new. I tried adding and enabling the following cloud.conf file in my main pi Apache’s sites-available directory but that breaks some of my other domains and does not redirect to the Nextcloud instance. What is the correct way of redirecting that subdomain?
<VirtualHost *:443>
ServerName cloud.domain.com
ServerAlias cloud
ProxyPass / https://192.168.1.200:443
ProxyPassReverse / https://192.168.1.200:443
ProxyPreserveHost On
ProxyPass /.well-known/acme/ !
</VirtualHost>
Should I also redirect port 80? Also, I would like to use ssl with lets-encrypt for Nextcloud, as I am doing with the main domain. Should I just run certbot on the nextcloud pi instance as I did on the main pi, or is it more complicated than that?