Use 2 URL for different parts of the same app


I need advice on how to setup my app.

Basic idea : I want my app accessible by 2 different URL :

  • domainA .com, my main url which point to my root page
  • domainB .com, which points to another page of my app :

I don’t have any database issue, since my database can be shared between the two apps.

My setup now is
domainA -> AWS ELB -> 1 Instance AWS
and I use MUP to deploy, so no NGINX special configuration for now.

Ideally the user browsing with domainB .com won’t see the redirection to domainA .com

Is there any solution which can allow me to keep a single instance (and ideally still use MUP), and not having to use 2 instance and duplicate my app ?

Thanks !


What about other URLs?
Will will be the same as
Will all URLs in domainB be the same as with a prefix (pageB)?
Or only the first page is different and than other URLs are the same?


I am open to all suggestion in oder to keep it simple

I don’t mind re-defining all my pages in the rooter, and I don’t mind have all my to be the same as


For the simplest answer (just change the home of, other urls are the same) I manage to do it like this with iron-router (add to your /etc/hosts for testing):

Router.route('/', function () {
    let hostname = window.location.hostname;
    if (hostname === '') {
    } else {
    name: 'home',
    waitOn: function () {
      if (window.location.hostname === '') {
        return [
      return [


Thanks for your reply

I can understand your comment about the router part.

But I still can’t figure what happens when the user connect with the domain name.
For now, my domainA DNS points to my loadbalancer, which points to the IP of my server.
In this process, the URL get transformed into

Which part of my setup does this transformation ? is it a configuration of MUP ?