Proxypass / nginx? reverse proxy

I have cyberpanel running on ubuntu server 20.04 VM and a nextcloud ubuntu 20.04 VM both on same physical server. They are both on port 443 and have different IPs, how can I make to where the domains don’t conflict with each other.? I have panel.domain.com pointed at one and cloud.domain.com pointed at the other. I kinda know where to start but don’t. please help. I have 2 physical servers with both running multiple VMs and other applications.

https://openlitespeed.org/kb/reverse-proxy-basics/

Obviously, I kind of suggest you enable private networking between the VM for obvious reason, but I guess that’s up to you.

Thank you, I will check this out later on and get back to you.