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 ?


I have a similar question!
But my case is a bit different: I want to serve same app from different domains. The diff is app language.

  • sd open the app in english and show US data
  • and sd open the app in french and show France data

But app logic, user accounts, everything else is the same bw the domains.

That possible?


For the record, here is the solution I found

I deploy twice my application on the same EC2 instance, with a different mup configuration : same database, but two different names, two url and to different ports (on on the default port, and one on the 3002 port)

I then use 2 different Load Balancing : both points to the same instance, but one on port 80 and one on port 3002. Each of my domain name points to one of the two Load Balancing

On my app I use bordalix 's solution to test on the router the url used by the user to redirect him to the correct modules.

I don’t know if it is the best solution for you, but it could work I think.


offtopic: didn’t have a chance to work wit load balancing. what technology you use for it?


All my technologies are aws:
Instances for app and database are ec2
Load balancing are ELB
dns is Route 53

I use the ELB because it allows me to use natively a ssl certificate. I don’t use any other ELB feature (it only points to one instance, so no real load balancing actually)