2

on Server 1 below are website folder structure

posts/folder1 points to https://example.com/posts/folder1

posts/folder2 points to https://example.com/posts/folder2

On Server 2, folder 3 is a website code

So can posts/folder3 points to https://example.com/posts/folder3

Can this be achieved?

10
  • Are thecservers on the same local network? Feb 24, 2023 at 19:56
  • You used a couple DNS tags. Are you asking if this can be done with DNS? Feb 24, 2023 at 20:15
  • @RohitGupta I feel it is a cluster. Feb 24, 2023 at 20:48
  • @StephenOstermiller removed DNS tags, as I know that DNS entry are mapping of IP address to domain (example.com) and not to sub folders. Feb 24, 2023 at 20:50
  • 3
    It is a lot easier to use subdomains. https://folder1.example.com/ would be a lot easier to make work. Are you open to that? Feb 24, 2023 at 23:00

1 Answer 1

2

Similar variations of this question have been asked a few times here.

In order to "merge" the contents of 2 servers sharing a single domain name you need to use a reverse proxy. This would mean that all content on server2 will go through server1 (or Vice-Versa) or alternatively you could have a stand alone reverse proxy divvying requests between server 1 and server 2.

This can be achieved using mod_proxy if you are using Apache. NGINX has similar functionality.

There is no mechanism in common use which allows you to split directories between 2 servers without some kind of reverse proxy or load balancing in common use. (ie conceptually for the purposes of HTTP/HTTPS a domain resolves to a single IP address = a single Interface on a machine)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.