-3

Imagine you have several web sites deployed in different servers. It's posible to share the main domain? V.g.:

mydomain.com/site1
mydomain.com/site2
mydomain.com/site3

SunSparc
  • 968
  • 3
  • 10
  • 23
  • Short answer yes, not so short answer, yes, but you'll need something in front, like a proxy, or load balancer. – NickW May 17 '13 at 14:52
  • I am tempted to downvote this question as being overly vague. I think that it could used a bit of clarification. What is the network scenario? Are we to assume these web servers are all public? By "main domain" do you mean the second-level domain name (eg mydomain.com) or are you willing to consider third-level sub-domain names? Your URL examples show each web site as a sub-folder which is also a valid solution for having multiple public web sites sharing a single second-level domain name. @Apocatastasis, can you elaborate on the question? – SunSparc May 17 '13 at 16:13
  • 1
    @SunSparc: Don't be tempted, just do it! – user9517 May 17 '13 at 16:33

1 Answers1

1

Short answer: yes. It's far far easier to use a subdomain since otherwise you would need a proxy.

To extend on this, suppose you have site1, site2, and site3 on different web servers. Rather than trying to mess with a proxy, simply add a subdomain to your domain like site1.domain.com that points to the proper web server.

The more complicated method (if you can't have/don't want subdomains) is to use something like nginx to proxy requests for the specific folders to a remote site. This page has a decent starting point: http://www.kirkdesigns.co.uk/nginx-proxy-apache-access-remote-host-ip-address-using-modpraf

Again, it's much much easier to just add a subdomain.

Nathan C
  • 14,901
  • 4
  • 42
  • 62