A
A
Alf19902020-01-14 16:52:30
Nginx
Alf1990, 2020-01-14 16:52:30

Forward all domain requests from one server to another?

There is a domain that is forwarded to a server with a direct IP.
There is a second server that does not have a real IP, but is connected to the same network, or free dyndns is connected.
The first server has nginx, and it has two domains.
Tell me how you can completely forward the second domain for all requests to another server?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lev Zabudkin, 2020-01-15
@zabudkin

On the first server, in the settings of the second domain that is connected there, do:
location / {
proxy_pass http://ip_where_the_second_domain:port_probably_80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question