For anyone reading this, I never figured out what was going wrong, so I deleted everything and started again using this guide. I managed to get nextcloud installed with self-signed certificates.
Now I canāt get the android app to connect, but Iāll start another thread for that.
Thank you to everyone who responded