1

Is it possible to have the same domain across two different servers distinguished by just a folder name.

E.g.

Server 1 www.domain.com/publicstuff

Server 2 www.domain.com/privatestuff

Other considerations.

  • The servers might not be on the same IP range,
  • The servers might not be in the same physical location
  • The servers will be using different web technologies and hosts
    • Drupal/Apache, Webforms/MVC/IIS
8
  • 2
    No, it's not. That is not how domain names work.
    – Jenny D
    Jul 26, 2017 at 14:04
  • I thought not but thought I would ask the wider community.
    – djack109
    Jul 26, 2017 at 14:05
  • 2
    @JennyD It's not how domain names work, but that doesn't mean it's not possible. This is something you could set up with AWS Cloudfront, for example, using it's ability to have multiple origins for a single distribution.
    – ceejayoz
    Jul 26, 2017 at 14:13
  • You are right of course, @ceejayoz - I was wrong to focus only on the DNS side of things. Thanks for correcting me!
    – Jenny D
    Jul 26, 2017 at 14:15
  • 1
    Why the down-vote ? It was a perfectly fair and reasonable question.
    – djack109
    Jul 28, 2017 at 7:24

2 Answers 2

4

As Jenny said, this is not generally possible. However, you could add a reverse proxy in front of your setup and map two external servers to two directories on your front end domain. Note that this is not necessarily possible for all web apps and might potentially increase latencies.

1
  • Thanks All. I said it wasn't a good idea so thanks for the back up
    – djack109
    Jul 26, 2017 at 14:15
1

Of course it possible, CDN-services or large sites can use this way.

Example for nginx:

location /publicstuff/ {
  root /var/www;
}
location /privatestuff/ {
    proxy_pass http://192.168.0.2;
}

Users vision: www.domain.com/publicstuff/ and www.domain.com/privatestuff/ are identical, but all queries to privatestuff are proxying to another server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .