Dinesh Saini
Dinesh Saini

Reputation: 2916

Single domain on multiple server

I have a domain with multiple active users with several applications hosting on it.

Domain: www.domain.com and running on server IP: XXX.XXX.XXX.1

I want to run www.domain.com/business on server IP: XXX.XXX.XXX.2

and similarly to run www.domain.com/hosting on server IP: XXX.XXX.XXX.3

It is very similar to Google scenario:

www.google.com runs on XXX.XXX.173.1 - XXX.XXX.185.1 www.google.com/+dinesh on XXX.XXX.186.1 -XXX.XXX.187.1

I have seen a lot of articles to manage DNS and virtual entries but unable to get correct answer.

Upvotes: 0

Views: 195

Answers (3)

Allen Luce
Allen Luce

Reputation: 8389

Another way to do this is to make the host portions slightly different, i.e.:

business.domain.com/business
hosting.domain.com/hosting

You would then use these links where you are currently putting www.domain.com/business and www.domain.com/hosting. It's then a simple matter to have those different hostnames point at different addresses.

In general, it's not possible to have URLs with the same host point to different IP addresses on the basis of the stuff after the hostname. I cannot seem to verify your Google example (from where I'm looking, they both go to the same set of addresses). If you've more information on how you determined those addresses, please post that and maybe something else can be suggested.

Upvotes: 1

Manish Maheshwari
Manish Maheshwari

Reputation: 4134

Please use a reverse proxy in front of the application servers.

Consider using nginx or Apache Httpd.

These can be configured to route (technically proxy) to the desired app servers by inspecting the context path in URL.

If you choose to use nginx, see this post on how to configure nginx for such a use case. Nginx configuration page for additional details: config

Upvotes: 1

user4288387
user4288387

Reputation:

You can manage it through Load balance rather than run on different server

Upvotes: 1

Related Questions