I
I
Ilya bow2016-08-15 16:13:40
PHP
Ilya bow, 2016-08-15 16:13:40

A web server anomizer that generates web pages depending on which domain it is accessed from. Really?

10.10.10.10 our server
Hosts of a person:
Domen1.ru 10.10.10.10
Domen2.ru 10.10.10.10
The idea is this. A person wants to go to domen1.ru
He somehow gets to our server. The server sees that our person needs domen1.ru. The server downloads domen1.ru and sends it to a human.
The same with domen2.ru
However, I'm a noob in this, tell me is it even possible? And if it is possible to google what to do?
By the way, there will be not two domains in the hosts, but many.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Zelensky, 2016-08-15
@SergeyZelensky-Rostov

Install nginx and the simplest thing that came to my mind is doing your own config file for each domain

server{
listen 80;
server_name domain1.ru;
location / {
  proxy_pass http://domain1.ru;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $phost;
}
}

I can't test it right now, but I think it should work.

D
Dmitry Evgrafovich, 2016-08-15
@Tantacula

Nginx and apache can. lmgtfy.com/?q=%D0%BD%D0%B5%D1%81%D0%BA%D0%BE%D0%BB...

E
Evgeny Bezymyannikov, 2016-08-15
@psman

Yes, everything is real, nginx in proxy mode needs to be configured.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question