N
N
nepster-web2014-01-08 23:42:04
PHP
nepster-web, 2014-01-08 23:42:04

How to host one page of the site on another server?

There are 2 servers.
Now such a task, for example,
ip 1 of the server 10.0.0.1
ip 2 of the server 10.0.0.2
For example, on server 1, the site.ru domain is attached to 10.0.0.1 and contains the site.
Is it possible to do this thing:
The test.html page is located on server 2, and you can access it through the domain (through 1 server)
, that is, we request site.ru/test.html, test.html is located on another server. Can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rozhik, 2014-01-08
@nepster-web

Yes, there are several ways to do this.
1. redirect (In the first method, the second server's url will be visible in the browser, probably not what you need)
2. proxying (the first server will turn to the second and give the content to the client)
Depending on the web server, implementations are different. I see in the nginx tag, so for him

server { ...
    location test.html {
         proxy_pass http://backend;
  }
}
upstream backend {
   server http://10.0.0.2
}

N
Nikolai Vasilchuk, 2014-01-09
@Anonym

In addition to @rozhik , you can connect the directory from server 2 via NFS on server 1 and work with files locally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question