Nginx and embedding MM via iframes

I’m using nginx to serve plex and a bunch of plex apps through sub domains on my site. I have a program called idashboard that lets me iframe any website into tabs on one page. idashboard is setup in the root nginx folder C:\nginx-1.11.5/html so that going to resolves to idashbaord. Since all the other plex services are setup in nginx as,, etc I can then just add those urls to idashbaord and it displays them perfectly in tabs. This also works for any other website as long as it is https and as long as the site doesn’t have xframe headers set to sameorigin. So i setup my tumblr blog, for example, in one of the tabs.

The problem is that i want to set up Mattermost as another tab, but MM does require it to be run on sameorigin (proxy_set_header X-Frame-Options SAMEORIGIN) But ok, i didn’t think that would be a problem since i do plan on running MM on the same machine/nginx server. BUT the other limitation is that MM can not run as a subdomain. Since idashboard is (and must be) set up to run from I can’t let MM run from the root. I think this leaves me with 1 option (that i can see) to run a second nginx server. But now im in over my head. I don’t know how that would work (or if its even a good idea, with respect to system resource usage), and If was able to configure a second nginx server that runs from something like https://<ip>:<port> from the same machine/ip, would that still be the sameorigin (in other words, what exactly does “same origin” mean? Same machine? same ip? same webserver?)

I’m open to literally any discussion/ideas on this topic. Hopefully someone can approach this from an angle i haven’t considered yet. Thanks for reading!