Nginx multiple domains, multiple IP, different url's

Looking for some NGINX help. I have domain1. com ( IP) that I want to point to quickbox and use for pretty much everything (letsencrypt is also serving the free SSL), then i have domain2. com ( IP) that i want to point to my NEXTCLOUD install and serve an SSL based on I’ve tried different vartions in NGINX (first time using it) and can get the site to either show as domain1. com or when using domain2. com it forwards me to and wnats me to login to quickbox any ideas?