How do I set up my ERPNext instance on erp.domain.com and app pages on portal.domain.com?

Here we go.

I have the following requirements:
domain.com → point to webshop/main site (haven’t implemented any webshop yet, contemplating implementation, needs to connect to items but frappe framework may be to slow loading times for SEO not sure yet, let’s assume for the sake of this thread it will be built in frappe as well and hosted on frappe cloud)
erp.domain.com → points to erpnext
portal.domain.com → points to page from my app’s www directory where resellers can log in and register and view their stats.

Just split the subdomains in DNS and used Nginx for routing, with SSL for both. While fiddling with domain setups, I came across How Ahrefs Counts Links and Domains: What SEOs Need to Know - Crowdo Blog . It actually gave me a neat perspective on tracking which domains point where, which helped me double-check my configs.