I'd probably have had better luck if I did that! I just remember a couple years ago I couldn't get nginx to work for Nextcloud and I found Caddy which has been my buddy since. It's automated https by default.
Course I've had to do nginx for work more recently but systems gave me the trusted cert lol