0

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.

Dinesh Saini
  • 2,917
  • 2
  • 30
  • 48

3 Answers3

1

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

1

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

Community
  • 1
  • 1
Manish Maheshwari
  • 4,045
  • 2
  • 15
  • 25
  • Reverse proxy is an additional software/service that needs to be installed and configured. I've updated the answer with configuration details, should you choose to use nginx. The pointer for you is that you would need a 'reverse proxy' for your needs. – Manish Maheshwari Nov 24 '14 at 18:49
  • I am using webrick since site is created in Rails – Dinesh Saini Nov 25 '14 at 11:10
  • It shouldn't matter what technology your app server is using. You can still install nginx and configure as suggested. – Manish Maheshwari Nov 25 '14 at 13:41
1

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.

Allen Luce
  • 7,859
  • 3
  • 40
  • 53