Nginx multiple domains, multiple IP, different url's

Looking for some NGINX help. I have domain1. com (1.1.1.1 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 (1.1.1.2 IP) that i want to point to my NEXTCLOUD install and serve an SSL based on domain2.com 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 domain1.com and wnats me to login to quickbox any ideas?