One network, Two separate Nextcloud instances on separate machines - reverse proxy set up?

I need help configuring NGINX to act as a reverse proxy for my two nextcloud instances. Each nextcloud is running NGINX as the webserver, and i think i just need to configure one of these to act as the reverse proxy for both? I would like to have my tld domains to be able to work without attaching a unique port to one of them.

Any help would be greatly appreciated.

This is the guide i used to set up my two nextcloud instances.

What exactly is your goal? Do you want to have e.g. cloud1.example.com and cloud2.example.com be separate Nextcloud instances, but have both domains pointed at the same IP so one reverse proxies and the other serves Nextcloud on the same machine?

no each server has it’s own separate domain:

  1. cloud.domain1.com
  2. cloud.cloud

My goal is to be able to host each of these nextclouds on my network and be able to access them via their proper domain names rather than

  1. cloud.domain1.com
  2. cloud.cloud:4443

I have a static IP address

One static IP address? Or a block of them? Are you on a residential ISP?

Actually I misspoke, I have residential service and my ip address changes from time to time, but I have ddclient set up on my servers to update the DNS records for my domains.

Just define two server names in your nginx config:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name cloud1.example.com
    ...
}

and a second one:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name cloud2.example.com
    ...
}

edit:
I haven’t read the reverse proxy part in the first place. But it should be a bit similar: