Reputation: 63
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?
Upvotes: 0
Views: 268
Reputation: 4084
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.
Upvotes: 1