0

I have Angular JS web application with REST API (Using Spring 4) deployed on Jboss EAP 7 server. For each Client I have web application URL like this: xyz.mydomain.com?clientId=12.

However some of my clients do not want my domain in url. They either want there own unique URL like dummy.theredomain.com.

Or at least they want there unique name in front of my domain like this clientname.mydomain.com?clientId=12.

Is there any way to achieve this?

grizzthedj
  • 7,131
  • 16
  • 42
  • 62
LeoScott
  • 63
  • 1
  • 9
  • You need to purchase domain & subdomain, configure your nginx for the domain request to route to your server. If you require more clarity I can write an answer. – Pulkit Apr 02 '18 at 08:23
  • Thanks for the comment. I got some Idea, but still can you write as answer. It will be very helpful, thanks in advance. – LeoScott Apr 02 '18 at 09:07

1 Answers1

1

To address this issue you can take help of nginx, buy your domain and in the nginx you configure your incoming request for any server to route it to your backend system.

You can either create multiple server block in you nginx conf file which can individual routing

server {
    server_name xyz.mydomain.com;
    # the rest of the config
    location / {
        proxy_pass http://localhost:9090
    }
}
server {
    server_name clientname.mydomain.com;
    location / {
        proxy_pass http://localhost:9090
    }
}

or else you can have a wildcard matching which will redirect all subdomain request to your backend server.

server{
        server_name mydomain.com  *.mydomain.com;
        # the rest of the config
        location / {
            proxy_pass http://localhost:9090
        }
    }

P.S. This approach will work for your domain only, this is very simple nginx configuration and you have to explore more to use if fully fledgedly but it will give you an idea on how to solve your problem.

Pulkit
  • 3,953
  • 6
  • 31
  • 55